コード例 #1
0
        public async Task <IActionResult> GetAllAsync()
        {
            try
            {
                var list = _mapper.Map <IEnumerable <ClientesViewModel> >(await _serviceBase.GetAllAsync());

                if (list == null)
                {
                    return(NotFound(MessagesStatics.NotFoundList));
                }

                return(CreatedAtAction(nameof(GetAllAsync), list));
            } catch
            {
                return(BadRequest(MessagesStatics.ErrorSearch));
            }
        }