public void Update(UpdateCustomerServiceDTO dto) { var CS = _DB.CustomerServices.SingleOrDefault(x => x.CustomerId == dto.CustomerId && x.ServiceId == dto.ServiceId && !x.IsDeleted); if (CS != null) { CS.UpdatedAt = DateTime.Now; CS.Price = dto.Price; CS.OrderDate = dto.OrderDate; _DB.CustomerServices.Update(CS); _DB.SaveChanges(); } }
public IActionResult Update([FromBody] UpdateCustomerServiceDTO dto) { _CSService.Update(dto); return(Ok(GetResponse("Updated"))); }