When creating a query with EF, Normally we will create an anonymous type in order to limit the number of columns returned.
But anonymous type cannot be returned or used as a parameter to a method call, which means all work related to that anonymous object should be done inside a single method. This is really bad.
And certainly, we don't want to create explicit types just to represent a subset of an existing entity.
In my point of view, we still wanna play with the existing entity (like Person), but in different scenarios, we just care about certain properties. So I believe the best way is to partially populate an entity. But it seems Linq 2 EF does not support it.
Any suggestions?
Thanks