Пример #1
0
        public static void Seed(Database context)
        {
            context.RoleVolunteers.AddOrUpdate(
                new RoleVolunteer
                {
                    RoleID = (int) RoleID.Volunteer,
                    VolunteerUsername = "******"
                }
            );

            context.RoleVolunteers.AddOrUpdate(
                new RoleVolunteer
                {
                    RoleID = (int)RoleID.Volunteer,
                    VolunteerUsername = "******"
                }
            );

            context.RoleVolunteers.AddOrUpdate(
                new RoleVolunteer
                {
                    RoleID = (int)RoleID.Admin,
                    VolunteerUsername = "******"
                }
            );

            context.SaveChanges();
        }
Пример #2
0
 public static void Seed(Database context, int number = 1)
 {
     context.Visits.AddRange(GetRandomVisits(number, context));
     context.SaveChanges();
 }