Beispiel #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();
        }
Beispiel #2
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new IgnisContext(
                serviceProvider.GetRequiredService <
                    DbContextOptions <IgnisContext> >()))
     {
         SeedRoleWorker(context);
     }
 }
 public IndexModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Beispiel #4
0
 public DeleteModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public EditModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Beispiel #6
0
 public DetailsModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }
Beispiel #7
0
 public CreateModel(Ignis.Models.IgnisContext context)
 {
     _context = context;
 }