// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, Yad2Data DataContect, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } // DataContect.Database.EnsureDeleted(); DataContect.Database.EnsureCreated(); // app.UseMvcWithDefaultRoute(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "Yad2Project", template: "{controller}/{action}/{id?}", defaults: new { controller = "Products", action = "Index" }, constraints: new { id = "[0-9]+" }); }); }
public UserRepository(Yad2Data context) { _context = context; }
public ProductRepository(Yad2Data context) { _context = context; }