Entity Framework projections
- by David McClelland
We are investigating the Entity Framework to see if it will meet our particular needs. Here is the scenario I am interested in:
I have a large table (let's call it VeryWideRecord) which has many columns, and it has a corresponding business object (it's also called VeryWideRecord). I would like to be able to query my database for a VeryWideRecord business object, but only have values for certain columns returned by the underlying SQL. Can I do this with the Entity Framework?
I am uncertain as to whether this could be done with the Entity Framework's table splitting feature, because the application needs to be able (at runtime) to change the columns that are requested. The reason for this is that we are trying to minimize the amount of information that is going across the wire.
I see how this could be done using NHibernate (example), but how can I do this with the Entity Framework?