Esempio n. 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, COREContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
            DataBaseInicializador.Initialize(context);
        }
Esempio n. 2
0
        public static void Initialize(COREContext context)
        {
            context.Database.EnsureCreated();
            if (context.Categorias.Any())
            {
                return;
            }
            var categorias = new Categorias[]
            {
                new Categorias {
                    Nombre = "Desfile", Descripcion = "Prueba fisica"
                },
                new Categorias {
                    Nombre = "Belleza", Descripcion = "Evalua Belleza "
                }
            };

            foreach (Categorias c in categorias)
            {
                context.Categorias.Add(c);
            }
            context.SaveChanges();
        }
Esempio n. 3
0
 public Categorias1Controller(COREContext context)
 {
     _context = context;
 }