How to: Pre-Generate Views to Improve Query PerformanceBefore the Entity Framework can execute a query against a conceptual model or save changes to the data source, it must generate a set of local query views to access the database. The views are part of the metadata which is cached per application domain. If you create multiple object context instances in the same application domain, they will reuse views from the cached metadata rather than regenerating them. Because view generation is a significant part of the overall cost of executing a single query, the Entity Framework enables you to pre-generate these views and include them in the compiled project Pre-generated views are validated at run time to ensure that they are consistent with the current version of the model and mapping files. The procedures in this topic use the School model. You can generate this model by completing the Quickstart. You can skip the first procedure if the build process is already generating model and mapping files in the output directory. http://msdn.microsoft.com/en-us/library/bb896240.aspx
to use it right click the model and choose generate view
===================== for visual studio 2012 use this one: |