Created
May 6, 2020 21:27
-
-
Save ankitvijay/ca4a695f1bb3cc038ca2fddea507d6e2 to your computer and use it in GitHub Desktop.
DDD Example - Version 2
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 Order | |
{ | |
private readonly List<OrderItem> _orderItems; | |
public Order() | |
{ | |
_orderItems = new List<OrderItem>(); | |
} | |
public IImmutableList<OrderItem> OrderItems => _orderItems.ToImmutableList(); | |
public void AddOrderItem(OrderItem orderItem) | |
{ | |
_orderItems.Add(orderItem); | |
} | |
public void RemoveOrderItem(OrderItem orderItem) | |
{ | |
_orderItems.Add(orderItem); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment