Example #1
0
 public static void Seed(KidChore2Context db)
 {
     CreateKids(db);
     db.SaveChanges();
     CreateRooms(db);
     db.SaveChanges();
     CreateKidRoom(db);
     db.SaveChanges();
 }
Example #2
0
 public static void CreateRooms(KidChore2Context db)
 {
     db.Rooms.AddOrUpdate(r => new { r.RoomName },
         new Room { RoomName = "Living Room" },
         new Room { RoomName = "Kitchen" },
         new Room { RoomName = "Bathroom" },
         new Room { RoomName = "Master Bathroom" },
         new Room { RoomName = "Game Room" },
         new Room { RoomName = "Front Room" }
         );
 }
Example #3
0
 public static void CreateKids(KidChore2Context db)
 {
     db.Kids.AddOrUpdate(k => new { k.FirstName, k.LastName },
         new Kid { FirstName = "Tyrone", LastName = "Cannon" },
         new Kid { FirstName = "Shaniqua", LastName = "Cannon" },
         new Kid { FirstName = "Johnny", LastName = "Cannon" },
         new Kid { FirstName = "Chad", LastName = "Cannon" },
         new Kid { FirstName = "TomMacklemoreSlimShady", LastName = "Cannon" },
         new Kid { FirstName = "David", LastName = "Cannon" },
         new Kid { FirstName = "KanyeWest", LastName = "Cannon" }
         );
 }
Example #4
0
 public static void CreateKidRoom(KidChore2Context db)
 {
     db.KidRooms.AddOrUpdate(k => new { k.KidId, k.RoomId },
         new KidRoom { KidId = 1, RoomId = 1 },
         new KidRoom { KidId = 2, RoomId = 2 },
         new KidRoom { KidId = 3, RoomId = 3 },
         new KidRoom { KidId = 4, RoomId = 4 },
         new KidRoom { KidId = 5, RoomId = 5 },
         new KidRoom { KidId = 6, RoomId = 6 },
         new KidRoom { KidId = 6, RoomId = 1 },
         new KidRoom { KidId = 5, RoomId = 2 },
         new KidRoom { KidId = 4, RoomId = 3 },
         new KidRoom { KidId = 3, RoomId = 4 },
         new KidRoom { KidId = 2, RoomId = 5 },
         new KidRoom { KidId = 1, RoomId = 6 }
         );
 }
Example #5
0
 public HomeAdapter()
 {
     db = new KidChore2Context();
 }