Cloud Storage Extensions provide high level abstraction of Azure Cloud storage.
- Register package
builder.Register(x =>
{
var context = x.Resolve<IComponentContext>();
var config = context.Resolve<IConfiguration>();
return new AzureCloudStorage(config[ConnectionString]);
})
.As<IContentStorage>();
- Configure storage
builder.Register(x =>
{
var context = x.Resolve<IComponentContext>();
var config = context.Resolve<IConfiguration>();
var cfg = new AzureStorageConfiguration(
config[ContentStorageHost],
config[MessageAttachmentsContainer],
config[MemberAvatarsContainer],
config[ChannelImagesContainer],
config[TempContainerName],
Convert.ToInt32(config[MessagePhotoSize]));
return cfg;
}).AsSelf();
- appsettings.json section
"AzureStorage": {
"ConnectionString": "[connection string to azure storage]",
"ContentStorageHost": "[content storage host]",
"MessageAttachmentsContainer": "message",
"MemberAvatarsContainer": "avatar",
"ChannelImagesContainer": "channel",
"TempContainerName": "temp",
"MessagePhotoSize": 300
}
This project is maintained by Softeq Development Corp. We specialize in .NET core applications.
We welcome any contributions.
Cloud Storage Extensions project is available for free use, as described by the LICENSE (MIT).