public static void Initialize(SistemaAcadContext context) { context.Database.EnsureCreated(); if (context.Categoria.Any()) { return; } var categorias = new Categoria[] { new Categoria { Nombre = "Programacion", Carrera = "Informática", Descripcion = "Curso de programacion ASP", Estado = true }, new Categoria { Nombre = "Diseño Grafico", Carrera = "Informática", Descripcion = "Curso de diseño gráfico", Estado = true }, new Categoria { Nombre = "Matematicas", Carrera = "Informática", Descripcion = "Algebra Lineal", Estado = true }, new Categoria { Nombre = "Programación", Carrera = "Informática", Descripcion = "Curso de Programación ASP", Estado = true } //Carrera Informatica }; foreach (Categoria c in categorias) { context.Categoria.Add(c); } context.SaveChanges(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, SistemaAcadContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
public CursosController(SistemaAcadContext context) { _context = context; }
public InstructoresController(SistemaAcadContext context) { _context = context; }
public CategoriasController(SistemaAcadContext context) { _context = context; }
public AsignacionController(SistemaAcadContext context) { _context = context; }
public EstudiantesController(SistemaAcadContext context) { _context = context; }
public InscripcionesController(SistemaAcadContext context) { _context = context; }
public PersonasController(SistemaAcadContext context) { _context = context; }