// 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, CheeseDbContext 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=Cheese}/{action=Index}/{id?}");
            });
            context.Database.EnsureCreated();
        }
Exemple #2
0
 public CheeseController(CheeseDbContext dbContext)
 {
     context = dbContext;
 }
Exemple #3
0
 public CategoryController(CheeseDbContext dbContext)
 {
     context = dbContext;
 }
Exemple #4
0
 public MenuController(CheeseDbContext dbContext)
 {
     context = dbContext;
 }
Exemple #5
0
 public CheeseController(CheeseDbContext dbContext)
 {
     //add the this.
     this.context = dbContext;
 }
 //constructor that takes instance of DKcontext
 public CheeseController(CheeseDbContext dbContext)
 {
     //set field to  be equal to Db context that is passed in to it
     context = dbContext;
 }
 public CategoryController(CheeseDbContext dbContext) //Placing it in Contrsuctor
 {
     context = dbContext;
 }