mirror of
https://github.com/jcreek/Creek.FileRepository.git
synced 2026-07-12 18:33:43 +00:00
feat(*): Add all repositories to factory
This commit is contained in:
@@ -44,25 +44,30 @@ namespace FileRepository
|
|||||||
/// Initialise an implementation of IFileRepository based on a selected enum member.
|
/// Initialise an implementation of IFileRepository based on a selected enum member.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="repositoryType">The type of repository to initialise, based on the enum member.</param>
|
/// <param name="repositoryType">The type of repository to initialise, based on the enum member.</param>
|
||||||
|
/// <param name="config">The configuration to initialise the repository.</param>
|
||||||
/// <returns>Returns an initialised repository.</returns>
|
/// <returns>Returns an initialised repository.</returns>
|
||||||
public static IFileRepository GetFileRepository(RepositoryType repositoryType, IConfiguration config)
|
public static IFileRepository GetFileRepository(RepositoryType repositoryType, IConfiguration config)
|
||||||
{
|
{
|
||||||
switch (repositoryType)
|
switch (repositoryType)
|
||||||
{
|
{
|
||||||
//case RepositoryType.Disk:
|
case RepositoryType.Disk:
|
||||||
// return new DiskRepo() { };
|
throw new NotImplementedException();
|
||||||
|
return new DiskRepository(config);
|
||||||
|
|
||||||
//case RepositoryType.MongoDb:
|
case RepositoryType.MongoDb:
|
||||||
// break;
|
throw new NotImplementedException();
|
||||||
|
return new MongoDbRepository(config);
|
||||||
|
|
||||||
//case RepositoryType.S3:
|
case RepositoryType.S3:
|
||||||
// break;
|
throw new NotImplementedException();
|
||||||
|
return new S3Repository(config);
|
||||||
|
|
||||||
case RepositoryType.Sftp:
|
case RepositoryType.Sftp:
|
||||||
return new SftpRepository(config);
|
return new SftpRepository(config);
|
||||||
|
|
||||||
//case RepositoryType.Sql:
|
case RepositoryType.Sql:
|
||||||
// break;
|
throw new NotImplementedException();
|
||||||
|
return new SqlRepository(config);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
string repositoryName = Enum.GetName(typeof(RepositoryType), value: repositoryType);
|
string repositoryName = Enum.GetName(typeof(RepositoryType), value: repositoryType);
|
||||||
|
|||||||
Reference in New Issue
Block a user