public static void Initialize(IServiceProvider serviceProvider) { using (var context = new RazorPagesContext( serviceProvider.GetRequiredService < DbContextOptions <RazorPagesContext> >())) { SeedProjects(context); SeedSpecialization(context); } }
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(); }
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(); }
public IndexModel(RazorPagesMovie.Models.RazorPagesContext context) { _context = context; }
public EditModel(RazorPagesMovie.Models.RazorPagesContext context) { _context = context; }
public DeleteModel(RazorPagesMovie.Models.RazorPagesContext context) { _context = context; }
public FinishModel(RazorPagesMovie.Models.RazorPagesContext context) { _context = context; }