I'm having some performance issues using Contains() on larger list.
After digging around, i found out that in Entity Framework 6.0, this has been adressed by adding DbInExpression. However, the provider has to support it. I dug around in my version of dotConnect (8.4.303.6) and found that the Provider's DbProviderManifest answers "false" to "SupportsInExpression()".
Here is the WorkItem for the changes in EF6 : http://entityframework.codeplex.com/workitem/245
So my question(s):
Are DbInExpression supported in more recent versions ? If not, are there plans to support it ?
This is a pretty big feature for us has we have data that comes from a third party source which is basically a list of IDs and we need to fetch all those items into a grid.
There are, of course, ways around this issues but most are not elegant.
EDIT: Installed 8.4.447 (trial) to look if "SupportsInExpression()" still answers false. It does.
Also found this interesting wiki page :
https://entityframework.codeplex.com/wi ... 0for%20EF6
Which has a paragraph about this :
Native support for Enumerable.Contains
EF6 introduces a new expression type, DbInExpression, which was added to address performance issues around use of Enumerable.Contains in LINQ queries. The DbProviderManifest class has a new virtual method, SupportsInExpression, which is called by EF to determine if a provider handles the new expression type. For compatibility with existing provider implementations the method returns false. To benefit from this improvement, an EF6 provider can add code to handle DbInExpression and override SupportsInExpression to return true. An instance of DbInExpression can be created by calling the DbExpressionBuilder.In method. A DbInExpression instance is composed of a DbExpression, usually representing a table column, and a list of DbConstantExpression to test for a match.