I wanna model Order and Product concept with the help of DDD but I wonder how to deal with it.
Suppose you have Order class that has OrderItem class as it's child and Order is Aggregate Root, and Order class has list of OrderItems and every OrderItem has a reference to Product Class. Product is Aggregate Root of course. I mean some thing like this :
public class Order{
...
public list<OrderItem> OrderItems {get;set;}
}
public class OrderItems{
...
public int Qty {get; set;}
public Product {get; set;}
}
public class Product{
...
}
but as far as i know I can't have a reference from child of Order Aggregate to Product Aggregate. how to deal with this ?
Tnx in forward.