Skip to content

Commit

Permalink
load payment and shipment types when raise event
Browse files Browse the repository at this point in the history
  • Loading branch information
basilkot committed Dec 14, 2023
1 parent b8d7062 commit 6ba289d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public override async Task SaveChangesAsync(IList<CustomerOrder> models)
repository.PatchRowVersion(originalEntity, modifiedOrder.RowVersion);

var oldModel = originalEntity.ToModel(AbstractTypeFactory<CustomerOrder>.TryCreateInstance());
await LoadOrderDependenciesAsync(oldModel);
_totalsCalculator.CalculateTotals(oldModel);

// Workaround to trigger update of auditable fields when only updating navigation properties.
Expand Down Expand Up @@ -147,6 +148,7 @@ public override async Task SaveChangesAsync(IList<CustomerOrder> models)
// We need to CalculateTotals for the new Order, because it is empty after entity.ToModel creation
_totalsCalculator.CalculateTotals(changedModel);

await LoadOrderDependenciesAsync(changedModel);
changedEntry.NewEntry = changedModel;
}

Expand Down

0 comments on commit 6ba289d

Please sign in to comment.