public void UpdateDoc(UpdateAccountingDocumentDto inputData) { var data = _repo.GetDoc(inputData.Id); /* * because data is now tracking under efcore context observable * we should check the rowversion here or should update it in Repository * otherwise ef core just can be aware of concurrencies when appear just before * savechanges not all of them! */ data.RowVersion = inputData.RowVersion; data.LastModifiedDate = DateTime.Now; data.Price = inputData.Price; data.Title = inputData.Title; data.Description = inputData.Description; _repo.UpdateDoc(data); }
public IActionResult Amghezi([FromForm] UpdateAccountingDocumentDto input) { Service.UpdateDoc(input); return(Ok()); }