Example #1
0
        // GET: OwnersController/Details/5
        public ActionResult Details(int id)
        {
            Owner owner = _ownerRepo.GetOwnerById(id);

            if (owner == null)
            {
                return(NotFound());
            }

            List <Dog>    dogs    = _dogRepo.GetDogsByOwnerId(owner.Id);
            List <Walker> walkers = _walkerRepo.GetWalkersInNeighborhood(owner.NeighborhoodId);
            List <Walk>   walks   = _walkRepo.GetUpcomingWalksByOwnerId(owner.Id);

            ProfileViewModel vm = new ProfileViewModel()
            {
                Owner         = owner,
                Dogs          = dogs,
                Walkers       = walkers,
                UpcomingWalks = walks
            };

            return(View(vm));
        }