Esempio n. 1
0
        public DogOwnerListViewModel GetAllDogOwners()
        {
            var dogOwners             = dogOwnerService.GetAllDogOwners();
            var dogOwnerListViewModel = new DogOwnerListViewModel {
                DogOwnerViewModels = dogOwners.Select(e => new DogOwnerViewModel {
                    OwnerName = e.OwnerName,
                    DogNames  = e.DogNameList
                }).ToList()
            };

            return(dogOwnerListViewModel);
        }
        // GET: RobsDogs
        public ActionResult Index()
        {
            var dogOwnerListViewModel = _mapper.MapDogOwners(_service.GetAllDogOwners());

            return(View(dogOwnerListViewModel));
        }