public async Task <IActionResult> PostAsync(int guardianId, [FromBody] SaveUrgencyResource resource) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorMessages())); } var urgency = _mapper.Map <SaveUrgencyResource, Urgency>(resource); var result = await _urgencyService.SaveAsync(guardianId, urgency); if (!result.Success) { return(BadRequest(result.Message)); } var urgencyResource = _mapper.Map <Urgency, UrgencyResource>(result.Resource); return(Ok(urgencyResource)); }