<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>entityframework Discussions Rss Feed</title><link>http://entityframework.codeplex.com/discussions</link><description>entityframework Discussions Rss Description</description><item><title>New Post: VSIX EF6/EF5 IModelTransformExtension Problem</title><link>http://entityframework.codeplex.com/discussions/447468</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
This namespace changing has shown me an interesting issue.&lt;br /&gt;
&lt;br /&gt;
I have a VSIX loaded which is compiled against EF5 extensibility dll using IModelTransformExtension.&lt;br /&gt;
&lt;br /&gt;
I've just installed EFTools.msi, and in a client that uses a Model1.edmx file, I've added EF6 -Pre.&lt;br /&gt;
&lt;br /&gt;
As soon as I go to open the Model1.edmx I get an error:&lt;br /&gt;
&lt;br /&gt;
Cannot cast the underlying exported value of type 'MultiFileEDMX.ModelTransformExtension (ContractName=&amp;quot;Microsoft.Data.Entity.Design.Extensibility.IModelTransformExtension&amp;quot;)' &lt;br /&gt;
to type 'Microsoft.Data.Entity.Design.Extensibility.IModelTransformExtension'.	C:\DB\Dropbox\VS\VS12\EF\CGTE\MultiFileEdmx\MultiFileEdmxVs2012\MultiFileEdmxVs2012\MultiFileEdmxTest\MultiFileEdmxTest\Model1ef6.edmx&lt;br /&gt;
&lt;br /&gt;
Don't worry what VSIX it is. If I Disable the VSIX, the problem goes away.&lt;br /&gt;
&lt;br /&gt;
The point I'm making is that if I want to use Model First, my VS2012 cannot support both EF5 and EF6 at the same time.&lt;br /&gt;
A VSIX vendor is going to have to have two types available.&lt;br /&gt;
And the VS2012 User is going to to have switch Extensions versions or wait until all EF6 compatible ones are available.&lt;br /&gt;
&lt;br /&gt;
(Also, I have Update 3 RC loaded)&lt;br /&gt;
&lt;br /&gt;
What do you suggest?&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>jradxl</author><pubDate>Tue, 18 Jun 2013 20:55:53 GMT</pubDate><guid isPermaLink="false">New Post: VSIX EF6/EF5 IModelTransformExtension Problem 20130618085553P</guid></item><item><title>New Post: EFTools.Msi?</title><link>http://entityframework.codeplex.com/discussions/447415</link><description>&lt;div style="line-height: normal;"&gt;In the current release we are focusing mostly on being able to handle both EF5 and EF6 in the designer, being able to ship the EF designer out of band and making the codebase open source. There are some bug fixes but nothing dramatic. Also, as a side effect, the designer should be a little faster. In a longer term we would like to consolidate our story about tooling - more details here: &lt;a href="https://entityframework.codeplex.com/wikipage?title=Tooling%20Consolidation" rel="nofollow"&gt;https://entityframework.codeplex.com/wikipage?title=Tooling%20Consolidation&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>moozzyk</author><pubDate>Tue, 18 Jun 2013 15:13:46 GMT</pubDate><guid isPermaLink="false">New Post: EFTools.Msi? 20130618031346P</guid></item><item><title>New Post: EFTools.Msi?</title><link>http://entityframework.codeplex.com/discussions/447415</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
What changes in he EF Designer for EF6.&lt;br /&gt;
Are there bug fixes and/or new features.&lt;br /&gt;
Or is it just for the namespace changes?&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>jradxl</author><pubDate>Tue, 18 Jun 2013 12:40:45 GMT</pubDate><guid isPermaLink="false">New Post: EFTools.Msi? 20130618124045P</guid></item><item><title>New Post: Reduce trasferred data with Multiple Result Sets</title><link>http://entityframework.codeplex.com/discussions/447413</link><description>&lt;div style="line-height: normal;"&gt;Currently LINQ select statement with joining tables will result in returning one huge result set.&lt;br /&gt;
This looks excessive when we have one to many or many to many relationship.&lt;br /&gt;
&lt;br /&gt;
For example, we have Table1 and select 10 rows, which has many-to-many relationship with Table2 such that for every row in Table1 there is 50 rows in Table2.&lt;br /&gt;
In simple join we get 10*50 = 500 rows of data with Table1+Table2.&lt;br /&gt;
If we use temporary tables in SQL server we can return &lt;strong&gt;Multiple Result Sets&lt;/strong&gt;, which strongly &lt;strong&gt;reduce data&lt;/strong&gt; to 10 rows Table1 + 50 rows of Table2.&lt;br /&gt;
&lt;br /&gt;
It would be helpful to use this approach as &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;entity.Where(ent =&amp;gt; ent.Field &amp;gt; 2)
        .IncludeResultSet(ent =&amp;gt; ent.Table2);&lt;/code&gt;&lt;/pre&gt;

Currently in EF 5.0 it is possible to use multiple result sets only in stored procedures&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/data/jj691402.aspx" rel="nofollow"&gt;http://msdn.microsoft.com/en-us/data/jj691402.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>AArtur</author><pubDate>Tue, 18 Jun 2013 12:29:55 GMT</pubDate><guid isPermaLink="false">New Post: Reduce trasferred data with Multiple Result Sets 20130618122955P</guid></item><item><title>New Post: Automatically detect and refresh data changes in EF6</title><link>http://entityframework.codeplex.com/discussions/447398</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
it would be a great feature in EF6 to automatically detect and refresh data changes. I'm using DbContext and DbSet.&lt;br /&gt;
&lt;br /&gt;
A very good approach is described in Harry von Borstel's article&lt;br /&gt;
&amp;quot;AutoRefresh Entity Framework Data Using SQL Server Service Broker&amp;quot;&lt;br /&gt;
&lt;a href="http://www.codeproject.com/Articles/233770/AutoRefresh-Entity-Framework-data-using-SQL-Server" rel="nofollow"&gt;http://www.codeproject.com/Articles/233770/AutoRefresh-Entity-Framework-data-using-SQL-Server&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two problems with that solution:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;
Sometimes the refresh triggered by the CallContext is faster than then the reread of the changed entities. When using timestamps to prevent unintended overwrites of data SaveChanges results in an exception:&lt;br /&gt;
System.InvalidOperationException&lt;br /&gt;
HResult=0x80131509, COR_E_INVALIDOPERATION &lt;br /&gt;
The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: AcceptChanges cannot continue because the object's key values conflict with another object in the ObjectStateManager. Make sure that the key values are unique before calling AcceptChanges.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
The need of the AutoRefreshWrapper class to handle the CollectionChanged event. It is required, because the event is fired in another tread and must be dispatched to the main thread:&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;System.Windows.Application.Current.Dispatcher.BeginInvoke((Action)(notifyRefresh.OnRefresh));&lt;/code&gt;&lt;/pre&gt;

That could be avoided with a delegate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I tried another approach using SqlDependency and a DataTable to track changes. Unfortunately a second connection is needed and every monitored table needs a second query.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Mathias&lt;br /&gt;
&lt;/div&gt;</description><author>MathiasBonn</author><pubDate>Tue, 18 Jun 2013 10:22:29 GMT</pubDate><guid isPermaLink="false">New Post: Automatically detect and refresh data changes in EF6 20130618102229A</guid></item><item><title>New Post: Are there .pdb files for EF 5?</title><link>http://entityframework.codeplex.com/discussions/447345</link><description>&lt;div style="line-height: normal;"&gt;Are there .pdb files for EF 5? If so, where can I find them?&lt;br /&gt;
&lt;/div&gt;</description><author>ctaggart</author><pubDate>Mon, 17 Jun 2013 22:31:26 GMT</pubDate><guid isPermaLink="false">New Post: Are there .pdb files for EF 5? 20130617103126P</guid></item><item><title>New Post: Multi-Schema support for migrations (to support multi-tenancy for SaaS for example)</title><link>http://entityframework.codeplex.com/discussions/447211</link><description>&lt;div style="line-height: normal;"&gt;HI Tobias,&lt;br /&gt;
&lt;br /&gt;
To answer your question, yes, we do want to enable/improve our support for multi-tenancy in Migrations (and for EF in general). It is very unlikely that we will do anything for EF6 however.&lt;br /&gt;
&lt;br /&gt;
With respect to first-chance exceptions, I agree it is less than ideal, but it provides a simple, provider-agnostic way for us to detect the history table. We definitely want to improve this post EF6, possibly by introducing a lightweight provider model for DB metadata.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
&lt;br /&gt;
Andrew.&lt;br /&gt;
&lt;/div&gt;</description><author>AndrewPeters</author><pubDate>Mon, 17 Jun 2013 18:44:26 GMT</pubDate><guid isPermaLink="false">New Post: Multi-Schema support for migrations (to support multi-tenancy for SaaS for example) 20130617064426P</guid></item><item><title>New Post: getting "is not a configuration convention, so a data space must be specified" exception</title><link>http://entityframework.codeplex.com/discussions/447158</link><description>&lt;div style="line-height: normal;"&gt;This will be fixed with &lt;a href="https://entityframework.codeplex.com/workitem/1250" rel="nofollow"&gt;Work Item 1250&lt;/a&gt;. For now, you should be able to pass &lt;code&gt;DataSpace.SSpace&lt;/code&gt; into &lt;code&gt;Remove&lt;/code&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>BriceLambson</author><pubDate>Mon, 17 Jun 2013 18:34:29 GMT</pubDate><guid isPermaLink="false">New Post: getting "is not a configuration convention, so a data space must be specified" exception 20130617063429P</guid></item><item><title>New Post: cannot open power tools project</title><link>http://entityframework.codeplex.com/discussions/394777</link><description>&lt;div style="line-height: normal;"&gt;@kingcomxu, you must also install the Visual Studio 2010 Isolated Shell.&lt;br /&gt;
&lt;/div&gt;</description><author>BriceLambson</author><pubDate>Mon, 17 Jun 2013 18:29:27 GMT</pubDate><guid isPermaLink="false">New Post: cannot open power tools project 20130617062927P</guid></item><item><title>New Post: Conditional includes</title><link>http://entityframework.codeplex.com/discussions/447266</link><description>&lt;div style="line-height: normal;"&gt;Now we need to do something like this to do conditional includes&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/b/alexj/archive/2009/10/13/tip-37-how-to-do-a-conditional-include.aspx" rel="nofollow"&gt;http://blogs.msdn.com/b/alexj/archive/2009/10/13/tip-37-how-to-do-a-conditional-include.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
However it would be nice if it was possible to something like this.&lt;br /&gt;
&lt;br /&gt;
Context.Model.Include(x =&amp;gt; x.ModelState.Where(y =&amp;gt; y.VersionId == 4);&lt;br /&gt;
&lt;br /&gt;
Instead&lt;br /&gt;
&lt;br /&gt;
Regrads&lt;br /&gt;
&lt;br /&gt;
Morten&lt;br /&gt;
&lt;/div&gt;</description><author>mimse</author><pubDate>Mon, 17 Jun 2013 11:36:46 GMT</pubDate><guid isPermaLink="false">New Post: Conditional includes 20130617113646A</guid></item><item><title>New Post: EntityGraph and VS 2012 using Entity Framework 5</title><link>http://entityframework.codeplex.com/discussions/444422</link><description>&lt;div style="line-height: normal;"&gt;thanks so much for both of your replies..&lt;br /&gt;
&lt;br /&gt;
I followed the link where you discuss the possibility of integration with EF so I am looking forward to see what can be done to make this happen..&lt;br /&gt;
&lt;br /&gt;
Would you say that GBQ is at this point in time ready for me to use if I download the extension for EF 5?&lt;br /&gt;
In my first post, I mentioned some problems I had, can you please address them if at all possible?  Also, in our organization, we use Oracle database, so I wonder whether GBQ will work also with an Oracle database rather than MS SQL database?&lt;br /&gt;
&lt;br /&gt;
thanks again..&lt;br /&gt;
B.&lt;br /&gt;
&lt;/div&gt;</description><author>bokanowski</author><pubDate>Mon, 17 Jun 2013 06:38:08 GMT</pubDate><guid isPermaLink="false">New Post: EntityGraph and VS 2012 using Entity Framework 5 20130617063808A</guid></item><item><title>New Post: Is EF designer also open source?</title><link>http://entityframework.codeplex.com/discussions/383233</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
It's six months later now. Any news?&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>jradxl</author><pubDate>Mon, 17 Jun 2013 00:50:25 GMT</pubDate><guid isPermaLink="false">New Post: Is EF designer also open source? 20130617125025A</guid></item><item><title>New Post: When EF6 final will be released</title><link>http://entityframework.codeplex.com/discussions/442884</link><description>&lt;div style="line-height: normal;"&gt;It will be released with VS 2013 before the end of this year.&lt;br /&gt;
&lt;/div&gt;</description><author>ErikEJ</author><pubDate>Sun, 16 Jun 2013 18:10:45 GMT</pubDate><guid isPermaLink="false">New Post: When EF6 final will be released 20130616061045P</guid></item><item><title>New Post: Multi-Schema support for migrations (to support multi-tenancy for SaaS for example)</title><link>http://entityframework.codeplex.com/discussions/447211</link><description>&lt;div style="line-height: normal;"&gt;Hi folks,&lt;br /&gt;
&lt;br /&gt;
I am very interested in support for multiple database schemas with migrations. My concrete requirement is to use migrations to manage the same data model within a database for many tenants which I want to separate by database schema. Say we have a data model with one entity called &lt;em&gt;TheEntity&lt;/em&gt;. Furthermore lets say whe have two tenants identified by a GUID (00000000-0000-0000-0000-000000000001, 0x1 for short and 00000000-0000-0000-0000-000000000002, 0x2 for short). I want to run the code based migrations by using the &lt;em&gt;DbMigrator&lt;/em&gt; class and the tables should be created as follows:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;  0x1.__MigrationHistory
  0x1.TheEntity

  0x2.__MigrationHistory
  0x2.TheEntity&lt;/code&gt;&lt;/pre&gt;

I have worked through much of the entity framework and migrations code the last two days to check what could work right now and to be honest for me the handling of schemas within the migrations code seems to be a bit over complicated but maybe I do not get the benefit of the complexity and the necessity of it. But back to my concern:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;
I have a class called &lt;em&gt;SqlServerSchemaAwareMigrationSqlGenerator&lt;/em&gt; which inherits from &lt;em&gt;SqlServerMigrationSqlGenerator&lt;/em&gt;. This class overrides the method &lt;em&gt;Generate(CreateTableOperation createTableOperation)&lt;/em&gt; to replace the table name of the incomming &lt;em&gt;CreateTableOperation&lt;/em&gt;. My implementation replaces &amp;quot;dbo.[table-name]&amp;quot; with &amp;quot;[tenant-id].[table-name]&amp;quot;. Not a nice solution but thereby I achieve my goal to get the tables created in an own schema.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Next I set a &lt;em&gt;HistoryContextFactory&lt;/em&gt; on the &lt;em&gt;DbMigrationsConfiguration&lt;/em&gt; to set the schema of the HistoryContext.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
I tried using the class &lt;em&gt;DbMigrator&lt;/em&gt;. The first execution throws an _SqlException &amp;quot;Invalid object name '00000000-0000-0000-0000-000000000001._&lt;em&gt;MigrationHistory'.&amp;quot;&lt;/em&gt; which is wrapped into an &lt;em&gt;EntityCommandExecutionException&lt;/em&gt; which gets catched within &lt;em&gt;HistoryRepository.QueryExists(...)&lt;/em&gt;. The DbMigrator checks if the history table exists by catching EntityException??? Isn't that a bad pattern? The next problem appears on all following update processes. There is some code in &lt;em&gt;HistoryRepository.GetUpgradeOperations()&lt;/em&gt; which handles some legacy stuff (keyword &lt;em&gt;LegacyHistoryContext&lt;/em&gt;). The problem is that the code hardcodes the name of the history table as follows:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;  const string tableName = &amp;quot;dbo.&amp;quot; + HistoryContext.DefaultTableName;&lt;/code&gt;&lt;/pre&gt;

Hardcoded &amp;quot;dbo&amp;quot;? What the heck?&lt;br /&gt;
&lt;br /&gt;
Well, to be perfectly honest I realized that both exceptions are handled by the &lt;em&gt;HistoryRepository&lt;/em&gt; while writing this posting but am I right that the schema stuff in the migration code is suboptimal?&lt;br /&gt;
&lt;br /&gt;
My &lt;em&gt;SqlServerSchemaAwareMigrationSqlGenerator&lt;/em&gt; class is a bad and not very general solution I know. Are there any plans to support something like my scenario in the future? I know there are some demands on such features on stack overflow for example to make migrations suitable for multi-tenand-SaaS-solutions.&lt;br /&gt;
&lt;br /&gt;
Best regards from germany,&lt;br /&gt;
&lt;br /&gt;
Tobias Jamin&lt;br /&gt;
&lt;br /&gt;
PS: Maybe another topic with the name &lt;em&gt;migrations&lt;/em&gt; could be usefull to tag a discussion like this one.&lt;br /&gt;
&lt;/div&gt;</description><author>tjamin</author><pubDate>Sun, 16 Jun 2013 17:57:40 GMT</pubDate><guid isPermaLink="false">New Post: Multi-Schema support for migrations (to support multi-tenancy for SaaS for example) 20130616055740P</guid></item><item><title>New Post: DbContext.Database.SqlQueryAsync and DbContext.Database.SqlQueryAsync&lt;T&gt;</title><link>http://entityframework.codeplex.com/discussions/447186</link><description>&lt;div style="line-height: normal;"&gt;Hi again,&lt;br /&gt;
&lt;br /&gt;
sorry for this meaningless question as this already supports async, just like I was unable to get it working :)&lt;br /&gt;
&lt;br /&gt;
public async static Task GetWithSqlQueryAsync() {&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;            using (PeopleContext ctx = new PeopleContext()) {

                DbRawSqlQuery&amp;lt;Person&amp;gt; query = ctx.Database.SqlQuery&amp;lt;Person&amp;gt;(&amp;quot;SELECT Id, Name, Age, BirthDate, CreatedOn FROM People&amp;quot;);
                Person[] people = await query.ToArrayAsync();

                foreach (Person person in people) {

                    Console.WriteLine(person.Name);
                }
            }
        }&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>tugberk</author><pubDate>Sun, 16 Jun 2013 10:56:58 GMT</pubDate><guid isPermaLink="false">New Post: DbContext.Database.SqlQueryAsync and DbContext.Database.SqlQueryAsync&lt;T&gt; 20130616105658A</guid></item><item><title>New Post: DbContext.Database.SqlQueryAsync and DbContext.Database.SqlQueryAsync&lt;T&gt;</title><link>http://entityframework.codeplex.com/discussions/447186</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;DbContext.Database.SqlQuery&lt;/code&gt; method is very handy, especially the &lt;code&gt;DbContext.Database.SqlQuery&amp;lt;T&amp;gt;&lt;/code&gt; method. &lt;br /&gt;
&lt;br /&gt;
Is there any plans to add &lt;code&gt;DbContext.Database.SqlQueryAsync&lt;/code&gt; and &lt;code&gt;DbContext.Database.SqlQueryAsync&amp;lt;T&amp;gt;&lt;/code&gt; which would be &lt;code&gt;Task&lt;/code&gt; and &lt;code&gt;Task&amp;lt;T&amp;gt;&lt;/code&gt; returning and does proper asynchronous processing?&lt;br /&gt;
&lt;/div&gt;</description><author>tugberk</author><pubDate>Sun, 16 Jun 2013 09:46:53 GMT</pubDate><guid isPermaLink="false">New Post: DbContext.Database.SqlQueryAsync and DbContext.Database.SqlQueryAsync&lt;T&gt; 20130616094653A</guid></item><item><title>New Post: getting "is not a configuration convention, so a data space must be specified" exception</title><link>http://entityframework.codeplex.com/discussions/447158</link><description>&lt;div style="line-height: normal;"&gt;I'm using EF 6.0.0-beta1-20615 from nightly builds and I am getting an exception from the following code which was working on 6.0.0-beta1.&lt;br /&gt;
&lt;br /&gt;
I have the following DbContext class structure:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    public class ReservationContext : DbContext {

        public IDbSet&amp;lt;AccommodationProperty&amp;gt; AccommodationProperties { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder) {

            // Optional: If you would like your database table names to be singular
            modelBuilder.Conventions.Remove&amp;lt;PluralizingTableNameConvention&amp;gt;();
        }
    }&lt;/code&gt;&lt;/pre&gt;

&lt;blockquote&gt;
The specified convention of type 'System.Data.Entity.ModelConfiguration.Conventions.PluralizingTableNameConvention' is not a configuration convention, so a data space must be specified.&lt;br /&gt;
&lt;/blockquote&gt;
&lt;/div&gt;</description><author>tugberk</author><pubDate>Sat, 15 Jun 2013 18:16:44 GMT</pubDate><guid isPermaLink="false">New Post: getting "is not a configuration convention, so a data space must be specified" exception 20130615061644P</guid></item><item><title>New Post: When EF6 final will be released</title><link>https://entityframework.codeplex.com/discussions/442884</link><description>&lt;div style="line-height: normal;"&gt;I thought the idea was to move to a more agile, rapid-release schedule? It seems like this project has slowed down a lot from the pace you guys were at last year.&lt;br /&gt;
&lt;/div&gt;</description><author>MgSam</author><pubDate>Fri, 14 Jun 2013 19:48:58 GMT</pubDate><guid isPermaLink="false">New Post: When EF6 final will be released 20130614074858P</guid></item><item><title>New Post: EF6, Enumerable.Contains and auto compilation</title><link>http://entityframework.codeplex.com/discussions/447050</link><description>&lt;div style="line-height: normal;"&gt;There are no plans to enable auto-compiled query on queries with Enumerable.Contains in EF6. &lt;br /&gt;
&lt;br /&gt;
In general enabling auto-compiled query for those would be easy but two queries that differ only on the contents of the collection passed to Enumerable.Contains would still need to resolve to different cache entries because the two of them would need to translate to different SQL, e.g.:&lt;br /&gt;
&lt;br /&gt;
var list = new [] {1,2,3,4};&lt;br /&gt;
var query = db.Products.Where(p =&amp;gt; list.Contains(p.CategoryId);&lt;br /&gt;
// query translates to something like SELECT * FROM Products WHERE CategoryId IN (1,2,3,4)&lt;br /&gt;
list = new [] {5,6,7};&lt;br /&gt;
// now query translates to something like SELECT * FROM Products WHERE CategoryId IN (5,6,7)&lt;br /&gt;
&lt;br /&gt;
Auto-compiled query would still be able to help if you need to execute the same query with the same collection but varying some other parameter. &lt;br /&gt;
&lt;br /&gt;
One way we think we can enable auto-compiled queries to work in more scenarios with Enumerable.Contains is by adding the capability to EF to take advantage of Table Valued Parameters when the target database supports them. That should enable us to produce the exact same SQL for the two queries above and just pass different parameters each time.&lt;br /&gt;
&lt;br /&gt;
Diego&lt;br /&gt;
&lt;/div&gt;</description><author>divega</author><pubDate>Fri, 14 Jun 2013 09:59:56 GMT</pubDate><guid isPermaLink="false">New Post: EF6, Enumerable.Contains and auto compilation 20130614095956A</guid></item><item><title>New Post: EF6, Enumerable.Contains and auto compilation</title><link>http://entityframework.codeplex.com/discussions/447050</link><description>&lt;div style="line-height: normal;"&gt;Enumerable.Contains was optimized in EF6 but complex queries with Enumerable.Contains are still quite slow. I suspect, that such queries will not be auto compiled and the query translation takes all the time.&lt;br /&gt;
&lt;br /&gt;
Is this correct? If yes, will auto compilation support be implemented for Enumerable.Contains?&lt;br /&gt;
&lt;/div&gt;</description><author>thomasz</author><pubDate>Fri, 14 Jun 2013 08:21:31 GMT</pubDate><guid isPermaLink="false">New Post: EF6, Enumerable.Contains and auto compilation 20130614082131A</guid></item></channel></rss>