using HaBookCms.AzureStorage.AzureBlob.Implements;
using HaBookCms.AzureStorage.AzureBlob.Interfaces;
using HaBookCms.AzureStorage.AzureTable.Implements;
using HaBookCms.AzureStorage.AzureTable.Interfaces;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace HaBookCms.AzureStorage.ServiceExtension
{
public static class AzureStorageServiceCollectionExtensions
{
public static AzureStorageServiceBuilder builder { get; set; }
///
///
///
///
///
private static AzureStorageServiceBuilder AddServerBuilder(this IServiceCollection services)
{
return new AzureStorageServiceBuilder(services);
}
///
///
///
///
///
public static AzureStorageServiceBuilder AddAzureTableStorage(this IServiceCollection services)
{
if (builder == null) {
builder = services.AddServerBuilder();
}
services.AddSingleton();
return builder;
}
///
///
///
///
///
///
public static AzureStorageServiceBuilder AddConnection(this AzureStorageServiceBuilder builder, AzureStorageOptions databaseOptions)
{
// AzureStorageOptions databaseOptions = new AzureStorageOptions();
// databaseOptions.ConnectionString = _connectionString;
builder.Services.AddSingleton(databaseOptions);
return builder;
}
///
///
///
///
///
public static AzureStorageServiceBuilder AddAzureBlobStorage(this IServiceCollection services)
{
if (builder == null)
{
builder = services.AddServerBuilder();
}
services.AddSingleton();
return builder;
}
}
}