Esempio n. 1
0
        public ActionResult Index()
        {
            var result = new GetAllAnimalsViewModel();
            var getAll = _animalManager.GetAllAnimals();

            result.Animals = _mapper.Map <List <AnimalViewModel> >(getAll);

            return(View(result));
        }
        public string GetAllAnimalsJson()
        {
            var result     = new GetAllAnimalsViewModel();
            var getAnimals = _animalManager.GetAllAnimals();

            result.Animals = _mapper.Map <List <AnimalViewModel> >(getAnimals);

            var json = new JsonConvertor();

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