mirror of
https://github.com/jcreek/Creek.FileRepository.git
synced 2026-07-12 18:33:43 +00:00
refactor(*): Refactor GetFileRepository to simplify the factory class and handle bad repository types
Thanks to the enum it shouldn't be possible for there to be a bad repository type passed as an argument to this method, but this will handle it just in case.
This commit is contained in:
@@ -47,11 +47,26 @@ namespace FileRepository
|
||||
/// <returns>Returns an initialised repository.</returns>
|
||||
public IFileRepository GetFileRepository(RepositoryType repositoryType)
|
||||
{
|
||||
throw new NotImplementedException("This section won't work until another method is set up with at least one repository type.");
|
||||
switch (repositoryType)
|
||||
{
|
||||
//case RepositoryType.Disk:
|
||||
// return new DiskRepo() { };
|
||||
|
||||
//IFileRepository fileRepository = // Here we need to get the specific class of repository based on the RepositoryType enum.
|
||||
//case RepositoryType.MongoDb:
|
||||
// break;
|
||||
|
||||
//return fileRepository;
|
||||
//case RepositoryType.S3:
|
||||
// break;
|
||||
|
||||
//case RepositoryType.Sftp:
|
||||
// break;
|
||||
|
||||
//case RepositoryType.Sql:
|
||||
// break;
|
||||
|
||||
default:
|
||||
throw new ArgumentException($"{Enum.GetName(typeof(RepositoryType), value: repositoryType)} is not a valid repository type.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user