Example #1
0
 public static void Seed(KidChoreContext db)
 {
     CreateKids(db);
     db.SaveChanges();
     CreateRooms(db);
     db.SaveChanges();
 }
Example #2
0
 public static void CreateKids(KidChoreContext 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 #3
0
 public static void CreateRooms(KidChoreContext db)
 {
     db.Rooms.AddOrUpdate(r => new { r.Name, r.KidId },
         new Room {Name="Living Room", KidId=1 },
         new Room {Name="Kitchen", KidId=1 },
         new Room {Name="Bathroom", KidId=2 },
         new Room {Name="Master Bathroom", KidId=2 },
         new Room {Name="Game Room", KidId=3 },
         new Room {Name="Front Room", KidId=3 },
         new Room {Name="Backyard", KidId=4 },
         new Room {Name="Bedroom 1", KidId=4 },
         new Room {Name="Bedroom 2", KidId=5 },
         new Room {Name="Master Bedroom", KidId=5 },
         new Room {Name="Bedroom 3", KidId=6 },
         new Room {Name="Bedroom 4", KidId=6 },
         new Room {Name="Bedroom 5", KidId=7 },
         new Room {Name="Bedroom 6", KidId=7 }
         );
 }
Example #4
0
 public HomeAdapter()
 {
     db = new KidChoreContext();
 }
Example #5
0
 public List<Kid> GetKids()
 {
     List<Kid> Kids = new List<Kid>();
     KidChoreContext db = new KidChoreContext();
     Kids = db.Kids.ToList();
     return Kids;
 }