score:3

Accepted answer

Well, assignment operator aside, how would you expect your Apply method to be translated into SQL? Entity Framework doesn't know anything about it, and can't delve into opaque delegates, either.

I suspect what you really need to do is separate out the bits to do in the database from the bits to do locally:

var dbQuery =  from p in context.Parent
               join phr in context.Child on p.key equals phr.parentkey into pr
               select new { p, phr };

var localQuery = dbQuery.AsEnumerable()
                        .Select(pair => /* whatever */);

Related Articles