Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public void Should_Property_Set_And_Get_Options_For_Different_Containers()
}

[Fact]
public void Should_Fallback_To_Default_Configuration_If_Not_Specialized()
public void Should_Fallback_To_Default_ProviderType_When_Not_Explicitly_Configured()
{
Comment thread
EngincanV marked this conversation as resolved.
var config = _configurationProvider.Get<TestContainer3>();
config.ProviderType.ShouldBe(typeof(FakeBlobProvider1));
config.IsMultiTenant.ShouldBeFalse();
config.GetConfigurationOrNull("TestConfigDefault").ShouldBe("TestValueDefault");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public override void ConfigureServices(ServiceConfigurationContext context)
{
container.SetConfiguration("TestConfig2", "TestValue2");
container.ProviderType = typeof(FakeBlobProvider2);
})
.Configure<TestContainer3>(container =>
{
container.IsMultiTenant = false;
});
});
}
Expand Down
Loading