public async Task Update(MethodOfTreatmentUpdateDto dto) { try { var entity = await GetEntity(dto.Id); using (DHContext db = new DHContext()) { entity.Title = dto.Title; entity.Description = dto.Description; entity.DiseaseId = dto.DiseaseId; entity.Source = dto.Source; db.Entry(entity).State = EntityState.Modified; await db.SaveChangesAsync(); } } catch (Exception exc) { _logger.Error($"Failed Update MethodOfTreatment {dto.Id} : {exc}"); throw; } }
public async Task <JsonResult> Update(MethodOfTreatmentUpdateDto dto) { await _methodOfTreatmentCrudService.Update(dto); return(null); }