Created
April 20, 2023 13:05
-
-
Save bjoerntx/755579e3fe0d056996027dff4ff24527 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Invoice { | |
public Buyer Buyer { get; set; } | |
public List<LineItem> LineItems { get; set; } | |
public float Total { | |
get { | |
var total = 0F; | |
foreach (var item in LineItems) { | |
total += item.LineTotal; | |
} | |
return total; | |
} | |
} | |
} | |
public class LineItem { | |
public string ProductID { get; set; } | |
public string Name { get; set; } | |
public int Quantity { get; set; } | |
public float Price { get; set; } | |
public float LineTotal { | |
get { return Price * Quantity; } | |
} | |
} | |
public class Buyer { | |
public string Name { get; set; } | |
public string ContactName { get; set; } | |
public string Street { get; set; } | |
public string City { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment