// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, SimpleLibraryDbContext dbcontext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler(builder => builder.Run(async context => { context.Response.StatusCode = 500; await context.Response.WriteAsync("An unexpected error occured, please try again later"); })); } dbcontext.EnsureSeedDataForContext(); app.UseMvc(); }
public LibraryRepository(SimpleLibraryDbContext context) { _context = context; }