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