public void Configure(IApplicationBuilder app, IHostingEnvironment env, ProductionsContext productionsContext, INewOrderService newOrderService, IOrderPaidService orderPaidService) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "GeekBurger Production API V1"); }); productionsContext.Seed(); newOrderService.SubscribeToTopic("NewOrder"); orderPaidService.SubscribeToTopic("OrderChanged"); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app , IHostingEnvironment env , ProductionContext productionContext , INewOrderService newOrderService //, IPaidOrderService paidOrderService ) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); productionContext.Seed(); var availableProductionAreas = productionContext.ProductionAreas?.ToList(); //newOrderService.SubscribeToTopic("ProductionAreaChangedTopic", availableProductionAreas); newOrderService.SubscribeToTopic(/*"neworder"*/ "orderpaid", availableProductionAreas); //paidOrderService.SubscribeToTopic("orderpaid", availableProductionAreas); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Production Area API v1"); } ); /* * app.Run(async (context) => * { * await context.Response.WriteAsync("Hello World!"); * }); */ }