How do you I combine two sub queries with queryover with WithSubQuery ? I want something like below (exact syntax doesn't matter):
query.WithSubquery.WhereValue(QueryOver.Of<Child>()
.Where(m => m.Parent.Id == paretAlias.Id)
.Select(Projections.Max("SomeProp")))
.Lt(QueryOver.Of<Child>(() => childAlias)
.Where(m => childAlias.Id == parentAlias.Id)
.Select(Projections.Max("SomeOtherProp")));
I can't see any methods of WithSubquery that allows me to compare two methods. It has
Where : takes a lambda
WhereProperty : takes a property compares with a sub query
WhereValue : takes a value compares with a sub query
WhereExists : takes a query.
Basically I want a method with that takes sub query and compares with another sub query
A sample output query in the sql would be :
select * from Parent inner join child on parent.id = child.parentid where
(select max(SomeProp) from child where child.parentid = parent.id) > (select max(SomeOtherProp) from child where child.parentid = parent.id)