public void Configure(IApplicationBuilder app, IceCreamContext iceCreamContext) { iceCreamContext.Database.EnsureDeleted(); iceCreamContext.Database.EnsureCreated(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "IceCreamRoute", template: "{controller}/{action}/{id?}", defaults: new { controller = "IceCream", action = "Index" }, constraints: new { id = "[0-9]+" }); }); }
public Repository(IceCreamContext context) { _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IceCreamContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); DbInitializer.Initialize(context); }
public IceCreamsController(IceCreamContext context) { _context = context; }
public StudentsController(IceCreamContext context) { _context = context; }
public InstructorsController(IceCreamContext context) { _context = context; }