public override Basket Apply(Basket basket) { var policy = new DefaultCustomerDiscountPolicy(); var evaluatedBasket = new Basket(basket.Owner); foreach (var extent in basket.Contents) { var evaluatedProduct = policy.Apply(extent.Product, basket.Owner); evaluatedBasket.Contents.Add(extent.WithItem(evaluatedProduct)); } return evaluatedBasket; }
public override Basket Apply(Basket basket) { var policy = new DefaultCustomerDiscountPolicy(); var evaluatedBasket = new Basket(basket.Owner); foreach (var extent in basket.Contents) { var evaluatedProduct = policy.Apply(extent.Product, basket.Owner); evaluatedBasket.Contents.Add(extent.WithItem(evaluatedProduct)); } return(evaluatedBasket); }
public Product ApplyDiscountFor(IPrincipal user) { var dicountPolicy = new DefaultCustomerDiscountPolicy(); return dicountPolicy.Apply(this, user); }
public Product ApplyDiscountFor(IPrincipal user) { var dicountPolicy = new DefaultCustomerDiscountPolicy(); return(dicountPolicy.Apply(this, user)); }