This demo intends to show different ways of improving performance by optimizing LINQ queries yet displaying ways to monitor and debug activity that Entity Framework (ORM) generates in the backgroud
Dowload AdventureWorks2016 database at https://www.microsoft.com/en-us/download/details.aspx?id=49502
This demo makes use of the following components:
- EntityFramework 6.2
(Object Relational Mapper) - Log4Net
(Logging Tool) - Unity for ASP.Net MVC
(Dependency Injection) - StopWatch NuGet package
(Simple Performance Testing)
I strongly recommend the use of the following components in order to monitor activity, apply best practices for coding and boost performance:
-
SQL Server Profiler
(Obsolete, but still useful) -
SQL Server Extended Events
(Highly scalable and configurable tool to troubleshoot SQL performance issues) -
Fiddler
(Free web debugging tool) -
LINQPad
(Lightweight testing tool for .Net) - SonarLint
(IDE extension for Visual Studio)