TL;DR — Kurzzusammenfassung

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 mi

Hinweis: Dieser Artikel wurde ursprünglich veröffentlicht in 2011. Einige Schritte, Befehle oder Softwareversionen haben sich möglicherweise geändert. Überprüfen Sie die aktuelle Dokumentation von .Net für die neuesten Informationen.

Voraussetzungen

Bevor Sie beginnen, stellen Sie sicher, dass Sie Folgendes haben:

  • 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 Practice Impact Required Refactoring
Pre-generated Your View Major Minor
Use Small EDMX Files Minor Moderate
Create Smart Connection Strings Minor Minor
Disable Change Tracking Minor Minor
Use Compiled Queries Moderate Moderate
Be Careful With Includes Moderate Major
Source: https://www.codeproject.com/KB/database/PerfEntityFramework.aspx You can also learn more at: (https://learn.microsoft.com/en-us/library/bb896325.aspx “Managing connections and transactions”)

Zusammenfassung

Verwandte Artikel