Ejemplo n.º 1
0
        public ActionResult Index()
        {
            int ownerId = GetCurrentUserId();

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

            return(View(dogs));
        }
Ejemplo n.º 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));
        }