Viswanatha Swamy 811874b76a
Swamy/remove unused using and refactor the code (#1555)
* Removed Unused Using and Reorganized the Using

* Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API

* Revert "Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API"

This reverts commit 34241c430619b3b0bbeaabafa44c078c859237c4.

* Removed unused using and reorganized the using inside "Services" folder

* Removed Unused using and reoganized the using

* Refactor Webhooks.API

* Removed unused using and reorganized using inside Catalog.API

* Refactoring

* Removed unsed using

* Added line break just to differentiate between the messages

* Removed unused usings

* Simple Refactoring
2020-12-23 15:19:36 +05:30

22 lines
619 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
{
public class Basket
{
// Use property initializer syntax.
// While this is often more useful for read only
// auto implemented properties, it can simplify logic
// for read/write properties.
public List<BasketItem> Items { get; set; } = new List<BasketItem>();
public string BuyerId { get; set; }
public decimal Total()
{
return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity), 2);
}
}
}