public async Task <IActionResult> Put([FromBody] Medic medic) { if (!ModelState.IsValid) { return(CustomResponse(ModelState)); } Medic updatedMedic = await _medicService.UpdateAsync <MedicValidator>(medic); if (updatedMedic == null) { return(CustomResponse()); } return(Ok(_mapper.Map <Medic, MedicDTO>(updatedMedic))); }
public async Task <IActionResult> Put(string crm, [FromBody] Medic medic) { if (string.IsNullOrWhiteSpace(crm)) { return(BadRequest()); } Medic updatedMedic = await _medicService.UpdateAsync(crm, medic); if (updatedMedic == null) { return(NoContent()); } return(Ok()); }
public async void UpdateButtonClick() { await _medicService.UpdateAsync <MedicValidator>(_medic); }