You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace BlazingPizza
|
|
|
|
|
{
|
|
|
|
|
public class Order
|
|
|
|
|
{
|
|
|
|
|
public int OrderId { get; set; }
|
|
|
|
|
|
|
|
|
|
public string UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
public DateTime CreatedTime { get; set; }
|
|
|
|
|
|
|
|
|
|
public Address DeliveryAddress { get; set; } = new Address();
|
|
|
|
|
|
|
|
|
|
public List<Pizza> Pizzas { get; set; } = new List<Pizza>();
|
|
|
|
|
|
|
|
|
|
public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice());
|
|
|
|
|
|
|
|
|
|
public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00");
|
|
|
|
|
}
|
|
|
|
|
}
|