23 lines
508 B
C#
Raw Normal View History

2016-11-02 20:41:12 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
2016-11-02 20:41:12 +01:00
{
public class Basket
{
public Basket()
{
Items = new List<BasketItem>();
}
public List<BasketItem> Items { get; set; }
public string BuyerId { get; set; }
public decimal Total()
{
return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity),2);
2016-11-02 20:41:12 +01:00
}
}
}