private void SetupFileSystemStorages( List <IRdDataStorage> rdDataStorages, IdGeneratorManager idGeneratorManager, IConfiguration configuration) { var fileSystemStoragePath = configuration["FileSystem:Path"]; if (!string.IsNullOrEmpty(fileSystemStoragePath)) { var fileSystemBinaryDataStorage = new FileSystemBinaryDataStorage(fileSystemStoragePath); var fileSystemStorage = new BlobRdDataStorage( DataStorageTypes.FileSystem, fileSystemBinaryDataStorage, rdDataStorages.Single(x => x.Id == DataStorageTypes.MongoDB), idGeneratorManager); rdDataStorages.Add(fileSystemStorage); } }
private void SetupAzureBlobStorages( List <IRdDataStorage> rdDataStorages, IdGeneratorManager idGeneratorManager, IConfiguration configuration) { var azureBlobStorageAccountName = configuration["AzureBlobStorage:User"]; if (!string.IsNullOrWhiteSpace(azureBlobStorageAccountName)) { var accessKey = Secrets.Get(configuration["AzureBlobStorage:AccessKeyEnvironmentVariable"]); var azureCloudAccount = new CloudStorageAccount( new StorageCredentials(azureBlobStorageAccountName, accessKey), useHttps: true); var azureBlobStorage = new AzureBinaryDataStorage(azureCloudAccount); var rdAzureBlobStorage = new BlobRdDataStorage( DataStorageTypes.AzureBlobStorage, azureBlobStorage, rdDataStorages.Single(x => x.Id == DataStorageTypes.MongoDB), idGeneratorManager); rdDataStorages.Add(rdAzureBlobStorage); } }