I have a Entity Framework 4.1 DbContext based model. I am using a PocoModelGenerator.tt file to generate my entities. I found that querying a 20,000 row SQL table takes around 5 seconds from my code locally. It takes less than a second when done directly in SQL. In order to boost performance, I followed the approach in the link below to generate pre-compiled views:
http://blogs.msdn.com/b/adonet/archive/2008/06/20/how-to-use-a-t4-template-for-view-generation.aspx
But the performance didn't improve at all. It's actually a tad bit slower even when I am running it the 2nd or 3rd time. Here's the project structure I have:
Here are the properties for the generated MaterialsModel.Views.cs file:
I have the following questions:
- Any idea what can be the issue here?
- How do I check that the generated MaterialsModel.Views.cs is being compiled into the output assembly.
- How do I check that the generated views are indeed being used by my code?
- Are the properties setup correctly?