using System.Collections.Generic;
public string CustomerName { get; set; }
public double ProductTotal { get; set; }
public double Tax { get => ProductTotal * 0.19; }
public double Total { get => ProductTotal + Tax; }
public override string ToString() => return $"Order {CustomerName} {ProductTotal} {Tax} {Total}";
public static void Main()
var orders = new List<Order>{
new Order { CustomerName = "Joe", ProductTotal = 100 },
new Order { CustomerName = "Ion", ProductTotal = 89 },
new Order { CustomerName = "Georg", ProductTotal = 120 },
new Order { CustomerName = "George", ProductTotal = 5 }
var result = orders.OrderBy( order => order.Total).ToList();
foreach(var order in result)
public static void log(object o) { Console.WriteLine(o == null ? "null" : o.ToString()); }