I was reading through the manual/online docs but am unsure how to map this scenario, and hoped someone could help.
I have an Order class, and this order has two addresses (address class). One is a billing address and the other is delivery address. The address table has a discriminator column differentiating between the two.
Code:
interface IOrder
{
double Price { get; set; }
etc...
IAddress BillingAddress { get; set; }
IAddress DeliveryAddress { get; set; }
}
The address table has two relevant columns, the
OrderID - which order the addresses relate to, and the
Type (discriminator) - billing or delivery addresses. Each other has one or two addresses (Delivery Address is optional). There should never be two billing addresses for an order, they are 1 to 1 mappings.
Can anyone help me out with the suitable mapping please?