/// <inheritdoc/> public object Clone() { var cart = new StandardCart(this.priceList); foreach (var item in this.items) { cart.Add(item.Clone() as SkuCartEntry); } return(cart); }
private static ICart Merge(ICart cart1, ICart cart2, IDictionary <Sku, decimal> priceList) { ICart mergeCart = new StandardCart(priceList); Action <ICart, ICart> merger = (ICart src, ICart dst) => { foreach (var entry in src) { dst.Add(entry); } }; merger(cart1, mergeCart); merger(cart2, mergeCart); return(mergeCart); }