示例#1
0
        public static void Initializt(AspNetCoreContext context)
        {
            context.Database.EnsureCreated();

            if (context.Categoria.Any())
            {
                return;
            }
            var categorias = new Categoria[]
            {
                new Categoria {
                    categoriaName       = "Programacion",
                    catgoriaDescription = "Programacion",
                    categoriaStatus     = true
                },

                new Categoria {
                    categoriaName       = "Diseño Grafico",
                    catgoriaDescription = "Diseño Grafico",
                    categoriaStatus     = true
                }
            };

            foreach (Categoria item in categorias)
            {
                context.Add(item);
            }
            context.SaveChanges();
        }
示例#2
0
 public EditModel(AspNetCore.Data.AspNetCoreContext context)
 {
     _context = context;
 }
示例#3
0
 public IndexModel(AspNetCore.Data.AspNetCoreContext context)
 {
     _context = context;
 }
示例#4
0
 public DetailsModel(AspNetCore.Data.AspNetCoreContext context)
 {
     _context = context;
 }
示例#5
0
 public DeleteModel(AspNetCore.Data.AspNetCoreContext context)
 {
     _context = context;
 }