I have an OrderEntity which hold the general information (e.g. : OrderNo, TotalPrice...)
each OrderEntity have a child collection for OrderDetailEntity (e.g. : OrderEntity.OrderDetailCollection) which hold the detail information about the order (e.g. : ItemNo, Qty, UnitPrice, Discount...)
While the detail's unit price is updated, the related order's total price should also be updated.
The case is, there exists the validation on the validator for OrderEntity.TotalPrice which check the OrderEntity.TotalPrice cannot over certain limit. The whole update process should be rollbacked when the validation error is fired.
Since the validation error is fired from TotalPrice, not from UnitPrice, the UnitPrice can still be updated while the TotalPrice is remain unchanged.
Does anyone have idea to code this kind of checking so that the validation error can be returned to UnitPrice, not to TotalPrice?
thx.