Eliding async await


Normally, methods written async do not run faster than sync methods and only allow the system to respond to more requests. This topic was presented in the article How Thread pool works. ....
Read more

Wrong exception line number in stack trace in release mode


A few days ago, in one of the projects I was working on, an Object reference not set to an instance of an object error was issued, and the line where the error was issued was line 61 in the logs. When I checked line 61 ....
Read more

Create an Interceptor to find slow queries in EntityFramework Core


In this article we want to create an interceptor to find queries that take more than 2 seconds. To implement, we need to create a class that inherits from the DbCommandInterceptor class. The DbCommandInterceptor class is in EF Core 3 or higher ....
Read more

The difference between AsNoTracking and AsNoTrackingWithIdentityResolution


In the Entity Framework, every time we read one or more records of data from the database, they are tracked by ChangeTracker by default. And that gives us some performance reduction ....
Read more

The difference between throw and throw ex


throw, reissues the error with the same StackTrace as before. issues exactly the same error as before. But if you use throw ex, it still issues the same error as before, but with one difference, it resets StackTrace! For example ....
Read more