Browse Source

Resolved #4298: Database BLOB provider can configure the default container if not configured before

pull/4326/head
Halil İbrahim Kalkan 6 years ago
parent
commit
8f9ef8389e
  1. 2
      docs/en/Blob-Storing-Database.md
  2. 14
      modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/BlobStoringDatabaseDomainModule.cs

2
docs/en/Blob-Storing-Database.md

@ -55,6 +55,8 @@ If you want to use a separate database for BLOB storage, use the `AbpBlobStoring
### Configuring the Containers ### Configuring the Containers
If you are using only the database storage provider, you don't need to manually configure it, since it is automatically done. If you are using multiple storage providers, you may want to configure it.
Configuration is done in the `ConfigureServices` method of your [module](Module-Development-Basics.md) class, as explained in the [BLOB Storing document](Blob-Storing.md). Configuration is done in the `ConfigureServices` method of your [module](Module-Development-Basics.md) class, as explained in the [BLOB Storing document](Blob-Storing.md).
**Example: Configure to use the database storage provider by default** **Example: Configure to use the database storage provider by default**

14
modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/BlobStoringDatabaseDomainModule.cs

@ -10,6 +10,18 @@ namespace Volo.Abp.BlobStoring.Database
)] )]
public class BlobStoringDatabaseDomainModule : AbpModule public class BlobStoringDatabaseDomainModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
if (container.ProviderType == null)
{
container.UseDatabase();
}
});
});
}
} }
} }

Loading…
Cancel
Save