Exemplo n.º 1
0
        public async Task <ActionResult> Get()
        {
            var result = await _estadoService.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 <EstadoViewModelGet> >(result)));
        }
Exemplo n.º 2
0
        // GET: EstadoEntities
        public async Task <IActionResult> Index()
        {
            var estados = await _estadoService.GetAllAsync();

            if (estados == null)
            {
                return(Redirect("/Identity/Account/Login"));
            }

            return(View(estados));
        }
Exemplo n.º 3
0
        public async Task <ActionResult <IEnumerable <EstadoEntity> > > GetEstados()
        {
            var estados = await _estadoService.GetAllAsync();

            return(Ok(estados.ToList()));
        }
Exemplo n.º 4
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var paises = _mapper.Map <IEnumerable <EstadoViewModelGet> >(await _estadoService.GetAllAsync());

            return(View("Estado", paises));
        }
Exemplo n.º 5
0
        // GET: CidadeEntities/Create
        public async Task <IActionResult> Create()
        {
            var cidades = new CidadeViewModel(await _estadoService.GetAllAsync());

            return(View(cidades));
        }