Using Query Tags With Entity Framework Core 2.2

See the original posting on DZone Python

Entity Framework 2.2 introduces query tags that make it easier to find specific queries from logs and output windows of Visual Studio. When running an application in the development box, it’s possible to live without query tags. We can set breakpoints to see SQL code generated from LINQ queries. But how can we find queries from log files in multithreaded or multiuser scenarios?

Finding Queries From Logs Without Query Tags

But what if the site has multiple users at the same time? The following code works but it’s problematic.