// GET: Walkers public IActionResult Index() { int ownerId = GetCurrentUserId(); Owner owner = _ownerRepo.GetOwnerById(ownerId); List <Dog> dogs = _dogRepo.GetDogsByOwnerId(ownerId); List <Walk> allWalks = new List <Walk>(); foreach (Dog dog in dogs) { List <Walk> dogWalks = _walkRepo.GetAllWalksDog(dog.Id); foreach (Walk walk in dogWalks) { allWalks.Add(walk); } } return(View(allWalks)); }