public static BlobStorageManager CreateByConnectionString(string connectionString, string containerName)
 {
     if (string.IsNullOrWhiteSpace(connectionString))
     {
         throw new ArgumentNullException("Blob storage connection string can't be empty or null");
     }
     if (string.IsNullOrWhiteSpace(containerName))
     {
         throw new ArgumentNullException("ContainerName can't be empty or null");
     }
     return(new BlobStorageManager(BlobStorageConnectionString.Create(connectionString), containerName));
 }
示例#2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddApplicationLayer();
            services.AddPersistenceInfrastructure(_config);
            services.AddIdentityInfrastructure(_config);
            services.AddSharedInfrastructure(_config);
            services.AddSwaggerExtension();
            services.AddControllers();
            services.AddApiVersioningExtension();
            services.AddHealthChecks();
            services.AddScoped <IAuthenticatedUserService, AuthenticatedUserService>();

            var blobStorageConnectionString = new BlobStorageConnectionString
            {
                ConnectionString = _config["AzureBlob:ConnectionString"]
            };


            _config.Bind(nameof(blobStorageConnectionString), blobStorageConnectionString);
            services.AddSingleton(blobStorageConnectionString);

            services.AddScoped <AzureBlobHelper, AzureBlobHelper>();
            services.AddScoped <AzureBlobSavingService, AzureBlobSavingService>();
        }
 public BlobStorageManager(BlobStorageConnectionString conn, string containerName)
 {
     ConnectionString = conn;
     ContainerName    = containerName;
 }