* Moved Privacy, Home page to Razor Pages * Migrating Basket from RazorPages to Web. * Removed BasketController; refactored viewmodels * Moved BasketComponent into Pages/Shared Added auth rules to Startup for Pages Added notes to controllers about Pages usage. * Fixed broken my orders test Consolidated Functional Tests * Fixed logo link to home page Fixed Order Detail Total $ format
19 lines
470 B
C#
19 lines
470 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Microsoft.eShopWeb.Web.Pages.Basket
|
|
{
|
|
public class BasketViewModel
|
|
{
|
|
public int Id { get; set; }
|
|
public List<BasketItemViewModel> Items { get; set; } = new List<BasketItemViewModel>();
|
|
public string BuyerId { get; set; }
|
|
|
|
public decimal Total()
|
|
{
|
|
return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity), 2);
|
|
}
|
|
}
|
|
}
|