Multiple tables are mapped to one object using Entity Framework.

entity-framework

Question

I have a database with a table for active orders and one for inactive orders. I would like to model this in Entity Framework as one entity called Orders. I also need a way to determine if an order in this collection is active or not, preferably by having a status property on the entity that is set according to what table it is in. Is there anyway to do this using Entity Framework 1. What about in Entity Framework 4?

1
7
11/20/2009 5:30:05 PM

Accepted Answer

Take a look at the Table Per Concrete Type inheritance.
It is described here in ADO.NET Team Blog.

5
11/26/2009 2:46:49 PM

Popular Answer

You could create a view in your DB and generate the entity from that.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow