Hi all,
I'm trying to implement a custom result operator to attach query hints/lock modes for NHibernate. So, far I came up with the following query:
from c in db.Customers.WithLock(LockMode.Upgrade)
from o in c.Orders.WithLock(LockMode.Upgrade)
select new {o, c}
I want to be able to resolve a name of the query source ("c" and "o" respectively) as I need this information later.
I'm trying to get QuerySourceReferenceExpression using Resolve method (resolve identity lambda _=>_). But because I apply the result operator before the query source got it's name I'm getting "<generated>_X" as a name for both query source. However, for some reason, the both names are generated as <generated>_1 (I think this is because they are on different QueryModel's (one is on subquery, and one is on main, and they do not share the uniqueNameGenerator).
Any suggestions how I could achieve this?
Best Regards,
Alexander