public ActionResult <Order_Receipt> Update(Order_ReceiptUpdateDto Order_ReceiptUpdateDto) { try { return(service.Update(Order_ReceiptUpdateDto)); } catch (Exception error) { return(Conflict(error.Message)); } }
public Order_Receipt Update(Order_ReceiptUpdateDto dto) { // var isExist = GetDetail(dto.Name); // if (isExist != null && dto.Id != isExist.Id) // { // throw new Exception(dto.Name + " existed"); // } var entity = new Order_Receipt { // Id = dto.Id, // CreatedAt = dto.CreatedAt, // TotalPrice = dto.TotalPrice, // AccountId = dto.AccountId, // Books = dto.Books }; return(repository.Update(entity)); }