Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Olympia.Data.Domain
- {
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using Olympia.Data.Common.Models;
- public class ShoppingCart : BaseModel<string>
- {
- public ShoppingCart()
- {
- this.Items = new List<Item>();
- }
- public string UserId { get; set; }
- public OlympiaUser User { get; set; }
- public decimal EndPrice => this.GetEndPrice();
- public virtual ICollection<Item> Items { get; set; }
- private decimal GetEndPrice()
- {
- return this.Items.Sum(item => item.Price);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement