Hi,
If I write a Linq Query using Early Bound format, I see that CRM generates a QueryExpression with only the SELECT new CONTACT fields specified. If I write a Late Bound query and return an anonymous type (i.e. a var), then CRM still only selects
the fields specified in the SELECT NEW statement.
However want I really want is an Entity object that can be passed around rather than a var. I don't want to create my own "Contact" entity - I may as well have use early bound for that.
I have tried various ways to try and use "SELECT new Entity", but no matter what I try, the CRM Linq evaluator generates a Query Expression with "All Columns = true", which is very inefficient. I have tried various methods to just get
the required attributes, but CRM still seems to always set All Columns = true. I guess it can't evaluate the Linq query enough to determine which columns are being referenced.
Has anybody come up with a way to perform late bound Linq Queries that return a standard Entity object?