public async Task <IActionResult> Post([FromBody] Medic medic) { if (!ModelState.IsValid) { return(CustomResponse(ModelState)); } var _medic = await _medicService.SaveAsync <MedicValidator>(medic); if (_medic == null) { return(CustomResponse()); } var mappedMedic = _mapper.Map(medic, medic.GetType(), typeof(MedicDTO)); return(CreatedAtAction(nameof(Post), new { CRM = _medic.CRM }, _mapper.Map(medic, medic.GetType(), typeof(MedicDTO)))); }