// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, TreeChallengeDbContext dataContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Tree Challenge API V1"); c.RoutePrefix = string.Empty; }); app.UseRouting(); app.UseCors("CorsPolicy"); app.UseAuthorization(); dataContext.Database.Migrate(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapHub <FactoryHub>("/factoryHub"); }); }
public FactoryService(TreeChallengeDbContext treeChallengeDbContext) { _treeChallengeDbContext = treeChallengeDbContext; }