public async Task <IActionResult> Get(Guid id)
        {
            var result = await _contactManager.GetAsync(id);

            if (result.IsSuccess)
            {
                var resultDto = _mapper.Map <ContactListDto>(result.Data);
                return(Ok(resultDto));
            }
            return(BadRequest(new { Message = result.Message }));
        }
Ejemplo n.º 2
0
 public IActionResult Get(Guid id)
 {
     return(new WebApiGet <Contact?>(this, () => _manager.GetAsync(id),
                                     operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NotFound));
 }