Beispiel #1
0
        // 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;
 }
Beispiel #3
0
 public ProductRepository(Yad2Data context)
 {
     _context = context;
 }