Geeks With Blogs
Chandradev's Blog


Now in EF 5.0 i.e in VS 2011 default supporting the “Precompile query”.  Previously this feature was not there in EF. It will really give very good performance. Now no need to write any code for this functionality.

Just  now, i tested the code, We can also disable this feature like this.

protected void Page_Load(object sender, EventArgs e)


            using (var db = new TestEntities())


               // This line of code is used to disable the autocompile query

              //  db.ContextOptions.DefaultQueryPlanCachingSetting = false;

                var query = db.tblEmps.Select(m => m);              

                GridView1.DataSource = query;





Previously   “db.ContextOptions.DefaultQueryPlanCachingSetting”  property was not there in previous version.

Posted on Sunday, April 29, 2012 11:45 AM Entity Framework | Back to top

Comments on this post: PreCompile query is now available in EF 5.0 i.e in VS 2011

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Chandradev | Powered by: | Join free