예제 #1
0
 public IList <Animal> GetAllAnimals()
 {
     using (var ctx = new AnimalsContext())
     {
         return(ctx.Animals
                .Include(animal => animal.Home)
                .ToList());
     }
 }
예제 #2
0
 public IList <Home> GetAllHomes()
 {
     using (var ctx = new AnimalsContext())
     {
         return(ctx.Homes
                .Include(animal => animal.Animals)
                .ToList());
     }
 }