Example #1
0
        public static FileStorageServiceBuilder AddService <TFileStorage, TFileStorageOptions>(this FileStorageServiceBuilder builder, IConfiguration configuration, string?providerName = null)
            where TFileStorage : class, IFileStorage, new()
            where TFileStorageOptions : FileStorageOptions, new()
        {
            _ = builder ?? throw new ArgumentNullException(nameof(builder));
            _ = configuration ?? throw new ArgumentNullException(nameof(configuration));

            var section = configuration.GetSection("Pericia.Storage");

            return(builder.AddService <TFileStorage, TFileStorageOptions>(section, providerName));
        }
Example #2
0
 public static FileStorageServiceBuilder AddAzureBlobs(this FileStorageServiceBuilder builder, IConfigurationSection configuration)
 {
     return(builder.AddService <AzureBlobsStorage, AzureBlobsStorageOptions>(configuration, "Azure"));
 }
Example #3
0
 public static FileStorageServiceBuilder AddAzureBlobs(this FileStorageServiceBuilder builder, Action <AzureBlobsStorageOptions> storageOptionsConfig)
 {
     return(builder.AddService <AzureBlobsStorage, AzureBlobsStorageOptions>(storageOptionsConfig));
 }
Example #4
0
 public static FileStorageServiceBuilder AddOpenStack(this FileStorageServiceBuilder builder, IConfigurationSection configuration)
 {
     return(builder.AddService <OpenStackStorage, OpenStackStorageOptions>(configuration, "OpenStack"));
 }
Example #5
0
 public static FileStorageServiceBuilder AddOpenStack(this FileStorageServiceBuilder builder, Action <OpenStackStorageOptions> storageOptionsConfig)
 {
     return(builder.AddService <OpenStackStorage, OpenStackStorageOptions>(storageOptionsConfig));
 }
 public static FileStorageServiceBuilder AddS3(this FileStorageServiceBuilder builder, IConfigurationSection configuration)
 {
     return(builder.AddService <S3Storage, S3StorageOptions>(configuration, "S3"));
 }
 public static FileStorageServiceBuilder AddS3(this FileStorageServiceBuilder builder, Action <S3StorageOptions> storageOptionsConfig)
 {
     return(builder.AddService <S3Storage, S3StorageOptions>(storageOptionsConfig));
 }
Example #8
0
 public static FileStorageServiceBuilder AddFileSystem(this FileStorageServiceBuilder builder, IConfigurationSection configuration)
 {
     return(builder.AddService <FileSystemStorage, FileSystemStorageOptions>(configuration, "FileSystem"));
 }
Example #9
0
 public static FileStorageServiceBuilder AddFileSystem(this FileStorageServiceBuilder builder, Action <FileSystemStorageOptions> storageOptionsConfig)
 {
     return(builder.AddService <FileSystemStorage, FileSystemStorageOptions>(storageOptionsConfig));
 }