I have a web application that uses the Entity Framework to query a SQL Server database. I would like to know programmatically how many round-trip requests were made in the database. The idea is to log this information in order to easily detect errors in which the relationship was not included and caused many rounds.
Is there any way to achieve this? I don't mind if the solution is specific to SQL Server.
Note. I want to track the database programmatically , so tools like SQL Server Profiler do not suit me. I want to know, at the end of the request and in the code that processes the request, how many requests were made by this request.
source
share