コード例 #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;
 }