示例#1
0
        public ActionResult Index()
        {
            int ownerId = GetCurrentUserId();

            List <Dog> dogs = _dogRepo.GetDogsByOwner(ownerId);

            return(View(dogs));
        }
示例#2
0
        // GET: OwnerController/Details/5
        public ActionResult Details(int id)
        {
            Owner owner = _ownerRepo.GetOwnerById(id);

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

            List <Dog>    dogs    = _dogRepo.GetDogsByOwner(owner.Id);
            List <Walker> walkers = _walkerRepo.GetWalkersInNeighborhood(owner.NeighborhoodId);

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

            return(View(vm));
        }