You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was porting your C# code to F# when I've realized that something didn't add up and most notably how merging quantities is achieved in the current implementation:
I think it would be relevant to use a map or a dictionary to store the priced items.
It would make the whole consistency check a lot simpler.
Also why bother throwing exceptions when you can add a product when the same product isn't already part of the collection and then merge quantities when it is.
Wdyt?
The text was updated successfully, but these errors were encountered:
I was porting your C# code to F# when I've realized that something didn't add up and most notably how merging quantities is achieved in the current implementation:
samples/CQRS_Flow/.NET/Carts/Carts/Carts/Cart.cs
Lines 92 to 110 in a552bc5
samples/CQRS_Flow/.NET/Carts/Carts/Carts/Products/PricedProductItem.cs
Lines 46 to 52 in a552bc5
samples/CQRS_Flow/.NET/Carts/Carts/Carts/Products/ProductItem.cs
Lines 30 to 36 in a552bc5
Not only there is a redundant check as part of the current implementation:
samples/CQRS_Flow/.NET/Carts/Carts/Carts/Products/PricedProductItem.cs
Lines 41 to 44 in a552bc5
samples/CQRS_Flow/.NET/Carts/Carts/Carts/Products/ProductItem.cs
Lines 46 to 49 in a552bc5
but actually considering how data are stored:
samples/CQRS_Flow/.NET/Carts/Carts/Carts/Cart.cs
Line 21 in a552bc5
I think it would be relevant to use a map or a dictionary to store the priced items.
It would make the whole consistency check a lot simpler.
Also why bother throwing exceptions when you can add a product when the same product isn't already part of the collection and then merge quantities when it is.
Wdyt?
The text was updated successfully, but these errors were encountered: