Пример #1
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new RazorPagesContext(
                serviceProvider.GetRequiredService <
                    DbContextOptions <RazorPagesContext> >()))
     {
         SeedProjects(context);
         SeedSpecialization(context);
     }
 }
Пример #2
0
 public static void SeedSpecialization(RazorPagesContext context)
 {
     if (context.Specialization.Any())
     {
         return;   // DB has been seeded
     }
     //chequeo que el context specialization no sea nulo
     Check.Precondition(context.Specialization != null);
     context.Specialization.AddRange(GetSeedingSpecializations());
     context.SaveChanges();
 }
Пример #3
0
 public static void SeedProjects(RazorPagesContext context)
 {
     if (context.Project.Any())
     {
         return;   // DB has been seeded
     }
     //como precondición chequeo que el context project no sea nulo
     Check.Precondition(context.Project != null);
     context.Project.AddRange(GetSeedingProjects());
     context.SaveChanges();
 }
Пример #4
0
 public IndexModel(RazorPagesMovie.Models.RazorPagesContext context)
 {
     _context = context;
 }
Пример #5
0
 public EditModel(RazorPagesMovie.Models.RazorPagesContext context)
 {
     _context = context;
 }
Пример #6
0
 public DeleteModel(RazorPagesMovie.Models.RazorPagesContext context)
 {
     _context = context;
 }
Пример #7
0
 public FinishModel(RazorPagesMovie.Models.RazorPagesContext context)
 {
     _context = context;
 }