public void Configure(IApplicationBuilder app, IHostingEnvironment env, DashboardModelBuilder modelBuilder) { using (var scope = app.ApplicationServices.GetRequiredService <IServiceScopeFactory>().CreateScope()) { scope.ServiceProvider.GetService <CADContext>().Database.Migrate(); } var serviceProvider = app.ApplicationServices.GetService <IServiceProvider>(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseStatusCodePagesWithReExecute("/Error/{0}"); app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseMvc(routeBuilder => { routeBuilder.MapODataServiceRoute("ODataRoutes", "odata", modelBuilder.GetEdmModel(app.ApplicationServices)); }); }
public DashboardController() { _modelBuilder = new DashboardModelBuilder(); }