Entity Framework projections

Posted by David McClelland on Stack Overflow See other posts from Stack Overflow or by David McClelland
Published on 2011-02-11T22:40:04Z Indexed on 2011/02/11 23:25 UTC
Read the original article Hit count: 197

Filed under:

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?

© Stack Overflow or respective owner

Related posts about entity-framework