public static void Initialize(Simulador_de_negociosContext context)
        {
            context.Database.EnsureCreated();
            if (context.Producto_servicio.Any())
            {
                return;
            }
            var producto_servicio = new Producto_servicio[]
            {
                //new Alumno {Nombres="Leonel", ApellidoP="Gonzalez", ApellidoM ="Vidales", Edad =20, NumTelefono = "7321080568", Domicilio = "Av. Pungarabato Pte S/N", Colonia="Morelos", Ciudad ="Cd. Altamirano", CP =40660, Estado ="Guerrero"}
            };

            foreach (Producto_servicio a in producto_servicio)
            {
                context.Producto_servicio.Add(a);
            }
            context.SaveChanges();
        }
Example #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, Simulador_de_negociosContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
            DbInitializer.Initialize(context);
        }
 public Estimacion_serviciosController(Simulador_de_negociosContext context)
 {
     _context = context;
 }
Example #4
0
 public Producto_servicioController(Simulador_de_negociosContext context)
 {
     _context = context;
 }