public IEnumerable <HomeViewModel> GetAllHouses()
        {
            var houses = _animalManager.GetAllHomes();
            var result = _mapper.Map <List <HomeViewModel> >(houses);

            return(result);
        }
Example #2
0
        public ActionResult HomesDataPartialView()
        {
            var result  = new AnimalHomeCollectionViewModel();
            var getHome = _animalManager.GetAllHomes();

            result.ListAllModels = _mapper.Map <List <AnimalHomeViewModel> >(getHome);
            return(PartialView(result));
        }
Example #3
0
        // GET: api/Homes
        public string Get()
        {
            var homeList = _animalsManager.GetAllHomes();

            var result = _mapper.Map <IEnumerable <HomeViewModel> >(homeList);

            return(_jsonConverter.Convert(result));
        }
        public ActionResult Homes()
        {
            var homeList = _animalsManager.GetAllHomes();

            var result = new GetAllHomesViewModel();

            result.Homes = _mapper.Map <IList <HomeViewModel> >(homeList);

            return(View(result));
        }
Example #5
0
        public string Get()
        {
            var result  = new GetAllHomesViewModel();
            var getHome = _animalManager.GetAllHomes();

            result.Homes = _mapper.Map <List <HomeViewModel> >(getHome);

            var json = new JsonConvertor();

            return(json.Convert(result.Homes));
        }