예제 #1
0
        // GET: Vacina
        public async Task <ActionResult> Index()
        {
            var entity = await _vacinaService.GetAllAsync();

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

            var model = Mapper.Map <List <VacinaGetOutViewModel> >(entity);

            return(View(model));
        }
예제 #2
0
        public async Task <ActionResult <List <VacinaGetOutViewModel> > > Get()
        {
            var item = await _vacinaService.GetAllAsync();

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

            var result = Mapper.Map <List <VacinaGetOutViewModel> >(item);

            return(result);
        }