ICriteria
has SetComment()
, but I see nothing comparable for IQueryable
.
In NHibernate 5+ there is WithOptions
extension method that allows to set some query specific options like timeouts, cache options, and comments.
var query = (
from e in session.Query<YourEntity>()
select e
).WithOptions(o => o.SetComment("Your comment"));
You might need to import NHibernate.Linq
namespace.