@@ -41,17 +41,16 @@ public Data(OrderId id, Money maxTotalCost)
41
41
42
42
private static TrackedSet < Order . Item , DbOrderItem > CreateItemsSet ( Guid id ,
43
43
IEnumerable < DbOrderItem > dbOrderItems ) => new ( dbOrderItems ,
44
- item => new DbOrderItem
45
- {
46
- OrderId = id ,
47
- ProductId = item . ProductAmount . ProductId . Value ,
48
- AmountUnit = item . ProductAmount . Amount . Unit . ToString ( ) ,
49
- AmountValue = item . ProductAmount . Amount . Value ,
50
- PriceAgreementType = item . PriceAgreement . Type . ToString ( ) ,
51
- Price = item . PriceAgreement . Price ? . Value ,
52
- Currency = item . PriceAgreement . Price ? . Currency . ToString ( ) ,
53
- PriceAgreementExpiresOn = item . PriceAgreement . ExpiresOn
54
- } ,
44
+ item => new DbOrderItem (
45
+ id ,
46
+ item . ProductAmount . ProductId . Value ,
47
+ item . ProductAmount . Amount . Unit . ToString ( ) ,
48
+ item . ProductAmount . Amount . Value ,
49
+ item . PriceAgreement . Type . ToString ( ) ,
50
+ item . PriceAgreement . ExpiresOn ,
51
+ item . PriceAgreement . Price ? . Value ,
52
+ item . PriceAgreement . Price ? . Currency . ToString ( ) !
53
+ ) ,
55
54
dbItem => new Order . Item (
56
55
new ProductAmount (
57
56
ProductId . From ( dbItem . ProductId ) ,
@@ -76,7 +75,7 @@ protected override async Task SaveNestedDbEntities(IDbTransaction transaction)
76
75
var ( added , updated , deleted ) = _items . GetDiff ( ) ;
77
76
await transaction . Connection . InsertAllAsync ( added , transaction : transaction ) ;
78
77
await transaction . Connection . UpdateAllAsync ( updated ,
79
- qualifiers : i => new { i . OrderId , i . ProductId , i . AmountUnit } ,
78
+ qualifiers : i => new { i . OrderId , i . ProductId , i . AmountUnit } ,
80
79
transaction : transaction ) ;
81
80
await transaction . Connection . DeleteAllAsync ( deleted , transaction : transaction ) ;
82
81
}
0 commit comments