Пример #1
0
        private static void SeedRoleWorker(IgnisContext context)
        {
            if (context.RoleWorker.Any())
            {
                return;   // DB has been seeded
            }

            context.RoleWorker.AddRange(
                new RoleWorker
            {
                Title = "Camarografo",
                Level = Level.Basico
            },

                new RoleWorker
            {
                Title = "Grabacion",
                Level = Level.Avanzado
            },

                new RoleWorker
            {
                Title = "Sonidista",
                Level = Level.Basico
            },
                new RoleWorker
            {
                Title = "Fotografo",
                Level = Level.Avanzado
            }
                );
            context.SaveChanges();
        }
Пример #2
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new IgnisContext(
                serviceProvider.GetRequiredService <
                    DbContextOptions <IgnisContext> >()))
     {
         SeedRoleWorker(context);
     }
 }
Пример #3
0
 public IndexModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Пример #4
0
 public DeleteModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Пример #5
0
 public EditModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Пример #6
0
 public DetailsModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Пример #7
0
 public CreateModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }