示例#1
0
        public async Task <IActionResult> GetEspecialClients([FromHeader] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var client = await _clientAppService.GetByIdAsync(id);

            var clientViewModel =
                _mapper.Map <Client, ClientViewModel>(client);

            return(Ok(clientViewModel));
        }
示例#2
0
        public async Task <IActionResult> Get([FromRoute] int id)
        {
            var client = await _clientAppService
                         .GetByIdAsync(id)
                         .ConfigureAwait(false);

            if (client is null)
            {
                return(NotFound());
            }

            return(Ok(client));
        }