Example #1
0
 public IActionResult Get()
 {
     try
     {
         return(Json(_bancoRepository.ObterTodos()));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }
Example #2
0
        public async Task <IActionResult> BuscarTodosBancos()
        {
            try
            {
                var listaBancos = await _bancoRepository.ObterTodos();

                return(Response(listaBancos));
            }
            catch (Exception ex)
            {
                return(ResponseErro(ex));
            }
        }
Example #3
0
 public IActionResult Get()
 {
     try
     {
         return(Ok(_bancoRepository.ObterTodos()));
         //if (true)
         //{
         //    return BadRequest();
         //}
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.ToString()));
     }
 }
 public IEnumerable <BancoViewModel> ObterTodos()
 {
     return(_mapper.Map <IEnumerable <BancoViewModel> >(_bancoRepository.ObterTodos()));
 }