Note : Cet article a été publié à l’origine en 2011. Certaines étapes, commandes ou versions de logiciels ont pu changer. Consultez la documentation actuelle de .Net pour les informations les plus récentes.

Prérequis

Avant de commencer, assurez-vous d’avoir :

  • Visual Studio or .NET CLI installed
  • .NET Framework or .NET Core SDK
  • Basic C# programming knowledge
After writing code using entity framework for sometime and seeing the code base continue to grow I realized the importance of coding with performance in mind. There are things that come to mind like eager loading, but that alone won’t do much as your application continues to grow. Below are some key best practices I found on the web as well as links worthwhile examining as you look for ways to improve your performance: Best PracticeImpactRequired Refactoring
Pre-generated Your ViewMajorMinor
Use Small EDMX FilesMinorModerate
Create Smart Connection StringsMinorMinor
Disable Change TrackingMinorMinor
Use Compiled QueriesModerateModerate
Be Careful With IncludesModerateMajor
Source: http://www.codeproject.com/KB/database/PerfEntityFramework.aspx You can also learn more at: (http://msdn.microsoft.com/en-us/library/bb896325.aspx “Managing connections and transactions”)

Résumé

Articles Connexes