Hi,
I'm trying to set up what I think is a pretty simple data model in the Entity Framework. I've got two entities, OrderHeader and OrderLine.
OrderHeader
+---------+--------+
| Name | Type |
+---------+--------+
| Id | Int |
| Name | String |
+---------+--------+
OrderLine
+---------+--------+
| Name | Type |
+---------+--------+
| Id | Int |
| OrderId | Int |
| Name | String |
+---------+--------+
Whenever I call OrderHeader.OrderLines.Remove(someOrderLine), I want the OrderLine to be deleted from the database instead of leaving it orphaned, but I can't seem to do this in the Entity Framework. The Documentation states I should use a Referential Constraint, but that feature doesn't appear to work (For example, http://msdn.microsoft.com/en-us/library/dd456813%28VS.100%29.aspx refers to menus that don't exist). Any Ideas?