// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, NStoreContext nStoreContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. // app.UseHsts(); } // app.UseHttpsRedirection(); app.UseMiddleware <ErrorHandlerMiddleware>(); app.UseHealthChecks("/health"); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseSwagger(); app.UseSwaggerUI(o => o.SwaggerEndpoint("/swagger/v1/swagger.json", "NStore API v1")); // app.Use(async (ctx, next) => // { // Console.WriteLine("BEFORE"); //// Console.WriteLine($"PATH: {ctx.Request.Path}"); // await next(); // Console.WriteLine("AFTER"); // }); // // app.Run(async ctx => // { // Console.WriteLine("RUN"); // await Task.CompletedTask; // }); app.UseMvc(); // nStoreContext.Database.EnsureCreated(); // nStoreContext.Database.Migrate(); }
public AuthRepository(NStoreContext context) { _context = context; }
public EfProductRepository(NStoreContext context) { _context = context; }