public static IStorageBuilder AddSqlServerQueue(this IStorageBuilder builder, string name, Action <SqlServerQueueOptions> configure) { builder.AddQueueClient <SqlServerQueueClient, SqlServerQueueOptions>(name, configure); builder.Services.AddDbContext <QueueDbContext>((serviceProvider, dbContextBuilder) => { var optionsMonitor = serviceProvider.GetRequiredService <IOptionsMonitor <SqlServerQueueOptions> >(); var options = optionsMonitor.Get(Helpers.GetQualifiedQueueName(name)); dbContextBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); dbContextBuilder.UseSqlServer(options.ConnectionString); }, ServiceLifetime.Singleton, ServiceLifetime.Singleton); return(builder); }
public static IStorageBuilder AddAzureQueue(this IStorageBuilder storageBuilder, string name, ServiceLifetime serviceLifetime, Action <AzureQueueConfiguration> configure) { storageBuilder.AddQueueClient <AzureQueueClient>(name, serviceLifetime).Configure(configure); return(storageBuilder); }
public static IStorageBuilder AddRabbitMqQueue(this IStorageBuilder builder, string name, Action <RabbitMqQueueOptions> configure) { builder.AddQueueClient <RabbitMqQueueClient, RabbitMqQueueOptions>(name, configure); return(builder); }