public static void Inicializar(RegistroUsuariosContext registroUsuariosContext) { registroUsuariosContext.Database.EnsureCreated(); if (registroUsuariosContext.Categoria.Any()) { return; } var categorias = new Categoria[] { new Categoria { Nombre = "Wilson Contreras", Descripcion = "Arquitecto", FechaCreacion = DateTime.Now }, new Categoria { Nombre = "Leonard Maria", Descripcion = "Abogado", FechaCreacion = DateTime.Now } }; foreach (Categoria c in categorias) { registroUsuariosContext.Categoria.Add(c); } registroUsuariosContext.SaveChanges(); }
public DeleteModel(RegistroUsuarios.Data.RegistroUsuariosContext context) { _context = context; }
public IndexModel(RegistroUsuarios.Data.RegistroUsuariosContext context) { _context = context; }