LINQ to Entities / LINQ to SQL: switching from server (queryable) to client (enumerable) in the middle of a query comprehension?
问题 In many cases, I want to do some filtering (and sometimes projection) on the server side and then switch to client-side for operations that the LINQ provider doesn't natively support. The naive approach (which is basically what I do now) is to just break it up into multiple queries, similar to: var fromServer = from t in context.Table where t.Col1 = 123 where t.Col2 = "blah" select t; var clientSide = from t in fromServer.AsEnumerable() where t.Col3.Split('/').Last() == "whatever" select t