Query tagging won't help then (in case you want to rewrite queries to linq) as these are appended, not inserted up front.
Hmm. The method 'DaoBase.ExecuteMultiRowRetrievalQuery' is the method that's executed when you e.g. do a GetMulti. It's virtual, so you could override it in a partial class of CommonDaoBase, and in that overload insert a string at the front of the query.Command.CommandText. (using /* tag */)
The problem is: how to get the tag you want to insert there reliable into the Dao instance that's going to execute the query. As doing:
var collection = new CustomerCollection();
collection.GetMulti(...);
will create a new Dao instance (CustomerDao) on the fly, there's no way to pass the string to that. You could try a [ThreadStatic] marked static var perhaps:
[ThreadStatic]
public static string Tag = string.Empty;
then set that before the GetMulti call, in the override of ExecuteMultiRowRetrievalQuery, check if it's non-empty, if it's non-empty, insert it as /* tag */, and reset the Tag variable to string.Empty again.
It's somewhat reliable, but in asp.net (core) apps under heavy load your request might get stalled and passed on to another thread right at that moment. Unlikely but not impossible.
But as it's not a mission critical feature, it's likely one that would work out fine.