// GET: WalkersController/Details/5 public ActionResult Details(int id) { Walker walker = _walkerRepo.GetWalkerById(id); List <Walk> walks = _walkRepo.GetWalksByWalkerId(id); Neighborhood neighborhood = _neighborhoodRepo.GetNeighborhoodById(walker.NeighborhoodId); WalkerDetailsViewModel vm = new WalkerDetailsViewModel() { Walker = walker, Walks = walks, Neighborhood = neighborhood }; return(View(vm)); }
//// GET: Owners/Details/5 //public ActionResult Details(int id) //{ // Owner owner = _ownerRepo.GetOwnerById(id); // if (owner == null) // { // return NotFound(); // } // return View(owner); //} //Chp 5 model view method // GET: Owners/Details/5 public ActionResult Details(int id) { Walker walker = _walkerRepo.GetWalkerById(id); List <Walk> walks = _walkRepo.GetALLWalksandIds(walker.Id); //We used the items declared above.....to pair our new lists/paramenters with the requested Id //and then shoved it into a profileVIEW, then we returned it. (Had to change details panel) WalkerDetailsViewModel vm = new WalkerDetailsViewModel() { Walker = walker, // Dogs = dogs, Walks = walks }; return(View(vm)); }