예제 #1
0
 public IList <Home> GetAllHomes()
 {
     using (var ctx = new AnimalsContext())
     {
         return(ctx.Homes.Include(home => home.Cats).ToList());
     }
 }
예제 #2
0
 public IList <Cat> GetAllCats()
 {
     using (var ctx = new AnimalsContext())
     {
         return(ctx.Cats.Include(cat => cat.Home).ToList());
     }
 }