Ejemplo n.º 1
0
 protected override void Seed(EvotingContext context)
 {
     ConsituencySeed.Seed(context);
     VoterSeed.Seed(context);
     AdminSeed.Seed(context);
     PartySeed.Seed(context);
     CandidateSeed.Seed(context);
     ConfigSeed.Seed(context);
 }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity <Conference>().Metadata.FindNavigation(nameof(Conference.Candidates)).SetPropertyAccessMode(PropertyAccessMode.Field);
            modelBuilder.Entity <Conference>().Metadata.FindNavigation(nameof(Conference.JobOrders)).SetPropertyAccessMode(PropertyAccessMode.Field);
            modelBuilder.Entity <JobOrder>().Metadata.FindNavigation(nameof(JobOrder.ScheduleMatches)).SetPropertyAccessMode(PropertyAccessMode.Field);

            modelBuilder.Entity <Candidate>().HasData(CandidateSeed.AllCandidates());
            // modelBuilder.Entity<Client>().HasData(ClientSeed.AllClients());
            modelBuilder.Entity <Conference>().HasData(ConferenceSeed.AllConferences());
            // modelBuilder.Entity<JobOrder>().HasData(JobOrderSeed.AllJobOrders());
            modelBuilder.Entity <Branch>().HasData(BranchSeed.AllBranches());
        }