I may be misreading your reply, but what you describe appears to me like a future context.Evaluate function that could be called as context.Evaluate(() => 1 + 2) == 3, where 3 is obtained by running SELECT 1 + 2 on the database. If so, that is a separate issue from what I am facing now. And if I recall correctly, that's possible already by extending EF, a DbContext extension method can do that without any access to or modification of EF internals. (Of course, that's still nice to see in EF itself.) My expressions do start from an entity set, and I have reusable expressions that can be applied to those entities. For a more concrete example than C = A + B, consider an entity Person with stored properties Id, FirstName, LastName, and a calculated property FullName that returns FirstName + " " + LastName. EF is by design not able to perform a selection on the FullName property. The query I would like to run is from person in context.People select new { person.Id, person.FullName }; and I have attempted to solve that, to an extent, by making it possible to create a function getFullName, so that getFullName(entity) can be translated. A real function, of course, is still not possible, but the change I've made allows it to be written as from person in context.People select new { person.Id, getFullName.Compile()(person) }; where getFullName, in my real code, is actually a static readonly field rather than a local variable. Could you clarify whether that idea would be possible in another form with the change you've already got planned?
Cheers,
Harald