From b22d2f7f31b295a1ce664d1a2ceaf9f300e1bdca Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Mon, 30 Aug 2021 13:16:43 +0100 Subject: [PATCH] feat(*): Add base implementations of all repositories --- FileRepository/Repositories/DiskRepository.cs | 42 +++++++++++++++++++ .../Repositories/MongoDbRepository.cs | 42 +++++++++++++++++++ FileRepository/Repositories/S3Repository.cs | 42 +++++++++++++++++++ FileRepository/Repositories/SqlRepository.cs | 42 +++++++++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 FileRepository/Repositories/DiskRepository.cs create mode 100644 FileRepository/Repositories/MongoDbRepository.cs create mode 100644 FileRepository/Repositories/S3Repository.cs create mode 100644 FileRepository/Repositories/SqlRepository.cs diff --git a/FileRepository/Repositories/DiskRepository.cs b/FileRepository/Repositories/DiskRepository.cs new file mode 100644 index 0000000..a849667 --- /dev/null +++ b/FileRepository/Repositories/DiskRepository.cs @@ -0,0 +1,42 @@ +using FileRepository.Models; +using Microsoft.Extensions.Configuration; +using System; +using System.Threading.Tasks; + +namespace FileRepository.Repositories +{ + /// + /// The repository implementation for Disk. + /// + internal class DiskRepository : IFileRepository + { + /// + /// Initialises a new instance of the class with configuration. + /// + /// The configuration to initialise the repository with. + internal DiskRepository(IConfiguration config) + { + //this.host = config["DiskRepository:host"]; + } + + public async Task CreateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + + public async Task DeleteFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task ReadFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task UpdateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + } +} diff --git a/FileRepository/Repositories/MongoDbRepository.cs b/FileRepository/Repositories/MongoDbRepository.cs new file mode 100644 index 0000000..8302654 --- /dev/null +++ b/FileRepository/Repositories/MongoDbRepository.cs @@ -0,0 +1,42 @@ +using FileRepository.Models; +using Microsoft.Extensions.Configuration; +using System; +using System.Threading.Tasks; + +namespace FileRepository.Repositories +{ + /// + /// The repository implementation for MongoDb. + /// + internal class MongoDbRepository : IFileRepository + { + /// + /// Initialises a new instance of the class with configuration. + /// + /// The configuration to initialise the repository with. + internal MongoDbRepository(IConfiguration config) + { + //this.host = config["MongoDbRepository:host"]; + } + + public async Task CreateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + + public async Task DeleteFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task ReadFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task UpdateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + } +} diff --git a/FileRepository/Repositories/S3Repository.cs b/FileRepository/Repositories/S3Repository.cs new file mode 100644 index 0000000..d0f401c --- /dev/null +++ b/FileRepository/Repositories/S3Repository.cs @@ -0,0 +1,42 @@ +using FileRepository.Models; +using Microsoft.Extensions.Configuration; +using System; +using System.Threading.Tasks; + +namespace FileRepository.Repositories +{ + /// + /// The repository implementation for S3. + /// + internal class S3Repository : IFileRepository + { + /// + /// Initialises a new instance of the class with configuration. + /// + /// The configuration to initialise the repository with. + internal S3Repository(IConfiguration config) + { + //this.host = config["S3Repository:host"]; + } + + public async Task CreateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + + public async Task DeleteFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task ReadFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task UpdateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + } +} diff --git a/FileRepository/Repositories/SqlRepository.cs b/FileRepository/Repositories/SqlRepository.cs new file mode 100644 index 0000000..a2d2894 --- /dev/null +++ b/FileRepository/Repositories/SqlRepository.cs @@ -0,0 +1,42 @@ +using FileRepository.Models; +using Microsoft.Extensions.Configuration; +using System; +using System.Threading.Tasks; + +namespace FileRepository.Repositories +{ + /// + /// The repository implementation for SQL. + /// + internal class SqlRepository : IFileRepository + { + /// + /// Initialises a new instance of the class with configuration. + /// + /// The configuration to initialise the repository with. + internal SqlRepository(IConfiguration config) + { + //this.host = config["SqlRepository:host"]; + } + + public async Task CreateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + + public async Task DeleteFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task ReadFileAsync(string filename) + { + throw new NotImplementedException(); + } + + public async Task UpdateFileAsync(RepoFile file) + { + throw new NotImplementedException(); + } + } +}