Esempio n. 1
0
        public async Task <ActionResult> Get()
        {
            var result = await _cidadeService.GetAllAsync();

            if (_notify.HaveNotification())
            {
                return(Json(new { success = false, mensagem = string.Join(".", _notify.GetNotifications().Select(n => n.ErrorMessage).FirstOrDefault()) }));
            }
            return(View("_Lista", _mapper.Map <IEnumerable <CidadeViewModelGet> >(result)));
        }
Esempio n. 2
0
        // GET: CidadeEntities
        public async Task <IActionResult> Index()
        {
            var cidades = await _cidadeService.GetAllAsync();

            if (cidades == null)
            {
                return(View());
            }

            return(View(cidades));
        }
Esempio n. 3
0
        public async Task <ActionResult <IEnumerable <CidadeEntity> > > GetCidades()
        {
            var cidades = await _cidadeService.GetAllAsync();

            return(cidades.ToList());
        }
Esempio n. 4
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var paises = _mapper.Map <IEnumerable <CidadeViewModelGet> >(await _cidadeService.GetAllAsync());

            return(View("Cidade", paises));
        }