Ejemplo n.º 1
0
        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]+" });
            });
        }
Ejemplo n.º 2
0
 public Repository(IceCreamContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
        // 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);
        }
Ejemplo n.º 4
0
 public IceCreamsController(IceCreamContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public StudentsController(IceCreamContext context)
 {
     _context = context;
 }
 public InstructorsController(IceCreamContext context)
 {
     _context = context;
 }