StorageServiceCollectionExtensions
Namespace:
Microsoft.Azure.WebJobs.Host.Storage
We found 10 examples in language CSharp for this search.
You will see 14 fragments of code.
Other methods
Other methods
Project:AzureDeveloperTemplates
File:StorageServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorageServices(this IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
var storageConfiguration = serviceProvider.GetRequiredService<IStorageServiceConfiguration>();
services.TryAddSingleton(implementationFactory =>
{
BlobServiceClient blobServiceClient = new BlobServiceClient(storageConfiguration.ConnectionString);
return blobServiceClient;
});
return services;
}
Project:Cars-Island-On-Azure
File:StorageServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorageServices(this IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
var storageConfiguration = serviceProvider.GetRequiredService<IBlobStorageServiceConfiguration>();
services.AddSingleton(factory => new BlobServiceClient(storageConfiguration.ConnectionString));
services.AddSingleton<IBlobStorageService, BlobStorageService>();
return services;
}
Project:CarRentalProject
File:StorageServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorageServices(this IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
var storageConfiguration = serviceProvider.GetRequiredService<IBlobStorageServiceConfiguration>();
services.AddSingleton(factory => new BlobServiceClient(storageConfiguration.ConnectionString));
services.AddSingleton<IBlobStorageService, BlobStorageService>();
return services;
}
Project:goodfood
File:ServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorage(this IServiceCollection services)
{
services.AddSingleton<StorageManager>();
services.AddSingleton<IFileStorage, BlobFileStorage>();
return services;
}
Project:Explorer
File:StorageServiceCollectionExtensions.cs
Examples:2
public static IServiceCollection AddExplorerSpanStorage(
this IServiceCollection services,
Action<ISpanStorageBuilder> configure)
{
if (services == null) throw new ArgumentNullException(nameof(services));
services.AddSingleton<ISpanProcessor, SpanProcessor>();
configure(new SpanStorageBuilder(services));
return services;
}
public static IServiceCollection AddExplorerDependencyStorage(
this IServiceCollection services,
Action<IDependencyStorageBuilder> configure)
{
if (services == null) throw new ArgumentNullException(nameof(services));
configure(new DependencyStorageBuilder(services));
return services;
}
Project:EasyKeys.Extensions
File:StorageServiceCollectionExtensions.cs
Examples:2
/// <summary>
/// Add Local File Storage to DI registration.
/// </summary>
public static IServiceCollection AddFileStorage(
this IServiceCollection services,
string sectionName = " StorageProviders:FileStorage",
Action<FileSystemBlobStorageOptions, IServiceProvider>? configureOptions = default)
{
services
.AddChangeTokenOptions<FileSystemBlobStorageOptions>(
sectionName: sectionName,
configureAction: (opt, sp) => configureOptions?.Invoke(opt, sp));
services.AddScoped<IBlobContainer, FileSystemBlobStorage>();
services.AddScoped<IBlobStorage, FileSystemBlobStorage>();
return services;
}
/// <summary>
/// Add Memory File Storage to DI registration.
/// </summary>
/// <param name="services"></param>
/// <param name="sectionName"></param>
/// <param name="configureOptions"></param>
/// <returns></returns>
public static IServiceCollection AddMemoryStorage(
this IServiceCollection services,
string sectionName = " StorageProviders:MemoryStorage",
Action<InMemoryBlobStorageOptions, IServiceProvider>? configureOptions = default)
{
services
.AddChangeTokenOptions<InMemoryBlobStorageOptions>(
sectionName: sectionName,
configureAction: (opt, sp) => configureOptions?.Invoke(opt, sp));
services.AddScoped<IBlobContainer, FileSystemBlobStorage>();
services.AddScoped<IBlobStorage, FileSystemBlobStorage>();
return services;
}
Project:gl-dotnet-storage
File:StorageServiceCollectionExtensions.cs
Examples:3
public static IServiceCollection AddStorage(this IServiceCollection services)
{
services.TryAddTransient<IStorageFactory, Internal.StorageFactory>();
services.TryAdd(ServiceDescriptor.Transient(typeof(IStore<>), typeof(Internal.GenericStoreProxy<>)));
return services;
}
public static IServiceCollection AddStorage(this IServiceCollection services, IConfigurationSection configurationSection)
{
return services
.Configure<StorageOptions>(configurationSection)
.AddStorage();
}
public static IServiceCollection AddStorage(this IServiceCollection services, IConfigurationRoot configurationRoot)
{
return services
.Configure<StorageOptions>(configurationRoot.GetSection(StorageOptions.DefaultConfigurationSectionName))
.Configure<StorageOptions>(storageOptions =>
{
var connectionStrings = new Dictionary<string, string>();
ConfigurationBinder.Bind(configurationRoot.GetSection("ConnectionStrings"), connectionStrings);
if (storageOptions.ConnectionStrings != null)
{
foreach (var existingConnectionString in storageOptions.ConnectionStrings)
{
connectionStrings[existingConnectionString.Key] = existingConnectionString.Value;
}
}
storageOptions.ConnectionStrings = connectionStrings;
})
.AddStorage();
}
Project:MicrosoftAzureAI
File:StorageServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorageServices(this IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
var storageConfiguration = serviceProvider.GetRequiredService<IStorageServiceConfiguration>();
services.TryAddSingleton(implementationFactory =>
{
BlobServiceClient blobServiceClient = new BlobServiceClient(storageConfiguration.ConnectionString);
return blobServiceClient;
});
services.AddSingleton<IStorageService, StorageService>();
return services;
}
Project:Smart-Accounting
File:StorageServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorageServices(this IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
var storageConfiguration = serviceProvider.GetRequiredService<IStorageServiceConfiguration>();
services.AddSingleton(implementationFactory =>
{
return new BlobServiceClient(storageConfiguration.ConnectionString);
});
services.AddTransient<IStorageService, StorageService>();
return services;
}
Project:Smart-Accounting
File:StorageServiceCollectionExtensions.cs
Examples:1
public static IServiceCollection AddStorageServices(this IServiceCollection services)
{
var serviceProvider = services.BuildServiceProvider();
var storageConfiguration = serviceProvider.GetRequiredService<IStorageServiceConfiguration>();
services.AddSingleton(implementationFactory =>
{
return new BlobServiceClient(storageConfiguration.ConnectionString);
});
services.AddTransient<IStorageService, StorageService>();
return services;
}
Microsoft.Extensions.Hosting.StorageServiceCollectionExtensions : Object
Methods :
public static IServiceCollection AddDashboardLogging(IServiceCollection services = )public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()