Exemplo n.º 1
0
        // 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();
        }
Exemplo n.º 2
0
 public LibraryRepository(SimpleLibraryDbContext context)
 {
     _context = context;
 }