public async Task <IActionResult> PostAsync([FromBody] SaveDocResource resource) { var doc = _mapper.Map <SaveDocResource, Doc>(resource); var result = await _docService.SaveAsync(doc); if (!result.Success) { return(BadRequest(new ErrorResource(result.Message))); } var docResource = _mapper.Map <Doc, DocResource>(result.Resource); return(Ok(docResource)); }