Example #1
0
        public decimal BasketTotal()
        {
            decimal basketTotal = 0;

            if (BasketItems != null)
            {
                basketTotal += BasketItems.Sum(basketItem => basketItem.Quantity * basketItem.Product.Price);
            }
            return(basketTotal);
        }
Example #2
0
 public decimal GetTotalPrice()
 {
     return(BasketItems.Sum(o => o.GetTotalPrice()));
 }
Example #3
0
 public decimal TotalPrice() => BasketItems.Sum(x => x.Price * x.Quantity);
 public decimal Total()
 {
     return(Math.Round(BasketItems.Sum(x => x.UnitPrice * x.Quantity), 2));
 }