Entity Structure Optimization

Entity Frameworkexcellent, but some queries are suboptimal. Is it possible to write some SQL queries manually or as representations of MS SQL Server 2008 R2, execute this, and then associate some objects with them? I have studied some generated SQL and they are pretty ugly ...

Question 2: Caching queries in SQL Server 2008 R2? I would like to have strong caching, how can I configure it? (with MySQL it's that simple).

+5
source share
1 answer

You have many options available to you. You can use .ExecuteStoreCommand () in EF 4.1 to execute SQL on the database, or you can also map stored procedures to EF. In addition, you can map views as objects in EF, if necessary.

SQL Server has very sophisticated caching mechanisms for data pages, as well as execution plans, and it is pretty automated for the developer. I would suggest placing a concrete example with the operations you want to optimize.

+5
source

All Articles