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)));
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
 public async void UpdateButtonClick()
 {
     await _medicService.UpdateAsync <MedicValidator>(_medic);
 }