Created
May 5, 2020 22:01
-
-
Save ankitvijay/a6196f80c85cc9ac3d219c9f2b91c913 to your computer and use it in GitHub Desktop.
DDD - Example - Version 1
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 ICollection<OrderItem> _orderItems; | |
public Order() | |
{ | |
_orderItems = new List<OrderItem>(); | |
} | |
public IReadOnlyCollection<OrderItem> OrderItems | |
{ | |
get => (IReadOnlyCollection<OrderItem>)_orderItems; | |
private set => _orderItems = (ICollection<OrderItem>)value; | |
} | |
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