Browse Source

Use fallback blob provider type.

Co-authored-by: Cursor <cursoragent@cursor.com>
pull/25615/head
Engincan VESKE 2 months ago
parent
commit
8003e1d439
  1. 8
      framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/BlobContainerConfiguration.cs
  2. 1
      framework/test/Volo.Abp.BlobStoring.Tests/Volo/Abp/BlobStoring/AbpBlobStoringOptions_Tests.cs
  3. 4
      framework/test/Volo.Abp.BlobStoring.Tests/Volo/Abp/BlobStoring/AbpBlobStoringTestModule.cs

8
framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/BlobContainerConfiguration.cs

@ -7,10 +7,16 @@ namespace Volo.Abp.BlobStoring;
public class BlobContainerConfiguration
{
private Type? _providerType;
/// <summary>
/// The provider to be used to store BLOBs of this container.
/// </summary>
public Type? ProviderType { get; set; }
public Type? ProviderType
{
get => _providerType ?? _fallbackConfiguration?.ProviderType;
set => _providerType = value;
}
/// <summary>
/// Indicates whether this container is multi-tenant or not.

1
framework/test/Volo.Abp.BlobStoring.Tests/Volo/Abp/BlobStoring/AbpBlobStoringOptions_Tests.cs

@ -33,6 +33,7 @@ public class AbpBlobStoringOptions_Tests : AbpBlobStoringTestBase
{
var config = _configurationProvider.Get<TestContainer3>();
config.ProviderType.ShouldBe(typeof(FakeBlobProvider1));
config.IsMultiTenant.ShouldBeFalse();
config.GetConfigurationOrNull("TestConfigDefault").ShouldBe("TestValueDefault");
}
}

4
framework/test/Volo.Abp.BlobStoring.Tests/Volo/Abp/BlobStoring/AbpBlobStoringTestModule.cs

@ -36,6 +36,10 @@ public class AbpBlobStoringTestModule : AbpModule
{
container.SetConfiguration("TestConfig2", "TestValue2");
container.ProviderType = typeof(FakeBlobProvider2);
})
.Configure<TestContainer3>(container =>
{
container.IsMultiTenant = false;
});
});
}

Loading…
Cancel
Save