Wednesday, 10 December 2014

Pregenerated Views for Entity Framework 6

When Entity Framework starts, it first builds a set of internal views that describes the database in an agnostic way. All further processing (queries, updates etc.) EF does, is performed against these views. Generating views however can be costly and will impact start up time of the application.
The startup time for a 1000 table context can be in excess of minutes.


However, this can be worked around by generating views at design time by using EFInteractiveViews Nuget Package. It allows you to pre-generate and save the generated views to a file. Neat!

Install the Nuget package: https://www.nuget.org/packages/EFInteractiveViews
Source code and documentation: https://efinteractiveviews.codeplex.com/