public Extent WithItem(Product item) { var newExtent = new Extent(item); newExtent.Quantity = this.Quantity; newExtent.Updated = this.Updated; newExtent.total = this.total; return newExtent; }
internal Extent ToDomainProductExtent() { var product = this.Product.ToDomainProduct(); var pe = new Extent(product); pe.Quantity = this.Quantity; pe.Updated = new DateTimeOffset(DateTime.SpecifyKind(this.UtcUpdated, DateTimeKind.Utc)); return pe; }
public Basket GetBasketFor(IPrincipal user) { if (user == null) { throw new ArgumentNullException("user"); } var b = new Basket(user); var basketLines = this.repository.GetBasketFor(user); foreach (var line in basketLines) { var basketItem = new Extent(line.Product); basketItem.Quantity = line.Quantity; b.Contents.Add(basketItem); } var discountedBasket = this.discountPolicy.Apply(b); return discountedBasket; }