mirror of https://github.com/abpframework/abp.git
5 changed files with 48 additions and 14 deletions
@ -0,0 +1,11 @@ |
|||
namespace Volo.Abp.BlobStoring |
|||
{ |
|||
public static class BlobContainerConfigurationProviderExtensions |
|||
{ |
|||
public static BlobContainerConfiguration Get<TContainer>( |
|||
this IBlobContainerConfigurationProvider configurationProvider) |
|||
{ |
|||
return configurationProvider.Get(BlobContainerNameAttribute.GetContainerName<TContainer>()); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.BlobStoring |
|||
{ |
|||
public class DefaultBlobContainerConfigurationProvider : IBlobContainerConfigurationProvider, ITransientDependency |
|||
{ |
|||
protected AbpBlobStoringOptions Options { get; } |
|||
|
|||
public DefaultBlobContainerConfigurationProvider(IOptions<AbpBlobStoringOptions> options) |
|||
{ |
|||
Options = options.Value; |
|||
} |
|||
|
|||
public virtual BlobContainerConfiguration Get(string name) |
|||
{ |
|||
return Options.Containers.GetConfiguration(name); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace Volo.Abp.BlobStoring |
|||
{ |
|||
public interface IBlobContainerConfigurationProvider |
|||
{ |
|||
BlobContainerConfiguration Get(string name); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue