Exemplo n.º 1
0
        public async Task <ActionResult <ClientDTO> > GetClient(int clientId)
        {
            try
            {
                var client = await _clientsRepository.GetClientAsync(clientId);

                if (client != null)
                {
                    return(Ok(_mapper.Map <ClientDTO>(client)));
                }
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }

            return(NotFound());
        }