minor naming

This commit is contained in:
Christian Arenas 2017-05-26 01:35:44 +02:00
parent 4399d6a4f3
commit ed0e548e2d
3 changed files with 19 additions and 6 deletions

View File

@ -126,10 +126,10 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
}); });
services.AddTransient<IBasketRepository, RedisBasketRepository>(); services.AddTransient<IBasketRepository, RedisBasketRepository>();
RegisterServiceBus(services); RegisterEventBus(services);
} }
private void RegisterServiceBus(IServiceCollection services) private void RegisterEventBus(IServiceCollection services)
{ {
if (Configuration.GetValue<bool>("AzureServiceBusEnabled")) if (Configuration.GetValue<bool>("AzureServiceBusEnabled"))
{ {

View File

@ -138,7 +138,7 @@
}); });
} }
RegisterServiceBus(services); RegisterEventBus(services);
} }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
@ -170,6 +170,8 @@
.Options); .Options);
integrationEventLogContext.Database.Migrate(); integrationEventLogContext.Database.Migrate();
ConfigureEventBus(app);
} }
private void WaitForSqlAvailability(CatalogContext ctx, ILoggerFactory loggerFactory, int? retry = 0) private void WaitForSqlAvailability(CatalogContext ctx, ILoggerFactory loggerFactory, int? retry = 0)
@ -196,7 +198,7 @@
} }
} }
private void RegisterServiceBus(IServiceCollection services) private void RegisterEventBus(IServiceCollection services)
{ {
if (Configuration.GetValue<bool>("AzureServiceBusEnabled")) if (Configuration.GetValue<bool>("AzureServiceBusEnabled"))
{ {
@ -218,5 +220,9 @@
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>(); services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
} }
protected virtual void ConfigureEventBus(IApplicationBuilder app)
{
var eventBus = app.ApplicationServices.GetRequiredService<IEventBus>();
}
} }
} }

View File

@ -142,7 +142,7 @@
}); });
} }
RegisterServiceBus(services); RegisterEventBus(services);
services.AddOptions(); services.AddOptions();
@ -178,6 +178,8 @@
.UseSqlServer(Configuration["ConnectionString"], b => b.MigrationsAssembly("Ordering.API")) .UseSqlServer(Configuration["ConnectionString"], b => b.MigrationsAssembly("Ordering.API"))
.Options); .Options);
integrationEventLogContext.Database.Migrate(); integrationEventLogContext.Database.Migrate();
ConfigureEventBus(app);
} }
protected virtual void ConfigureAuth(IApplicationBuilder app) protected virtual void ConfigureAuth(IApplicationBuilder app)
@ -191,7 +193,7 @@
}); });
} }
private void RegisterServiceBus(IServiceCollection services) private void RegisterEventBus(IServiceCollection services)
{ {
if (Configuration.GetValue<bool>("AzureServiceBusEnabled")) if (Configuration.GetValue<bool>("AzureServiceBusEnabled"))
{ {
@ -213,5 +215,10 @@
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>(); services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
} }
protected virtual void ConfigureEventBus(IApplicationBuilder app)
{
var eventBus = app.ApplicationServices.GetRequiredService<IEventBus>();
}
} }
} }