25 lines
517 B
C#
25 lines
517 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Microsoft.eShopOnContainers.WebMVC.Models
|
|||
|
{
|
|||
|
public class Basket
|
|||
|
{
|
|||
|
public Basket()
|
|||
|
{
|
|||
|
Items = new List<BasketItem>();
|
|||
|
}
|
|||
|
|
|||
|
public string Id;
|
|||
|
public List<BasketItem> Items { get; set; }
|
|||
|
public string BuyerId { get; set; }
|
|||
|
|
|||
|
public decimal Total()
|
|||
|
{
|
|||
|
return Items.Sum(x => x.UnitPrice * x.Quantity);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|