Esempio n. 1
0
        public async Task <IActionResult> GetAllAsync()
        {
            Response <IEnumerable <ClienteDTO> > response = new Response <IEnumerable <ClienteDTO> >();

            try
            {
                response = await _clienteApplication.GetAllAsync();

                if (response.IsSuccess)
                {
                    return(Ok(response));
                }
                else
                {
                    return(BadRequest(response));
                }
            }
            catch (Exception ex)
            {
                response.Data      = null;
                response.IsSuccess = false;
                response.Message   = ex.Message;

                return(BadRequest(response));
            }
        }