public async Task <ActionResult> Get()
        {
            try
            {
                var results = await eventoAppService.ObterEventosAsync();

                return(Ok(results));
            }
            catch (System.Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Banco de dados Falhou {ex.Message}"));
            }
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> ObterTodosEventossAsync()
 {
     return(Ok(await appService.ObterEventosAsync()));
 }