How can I convert that QueryOver<> code to use Query<> with NHibernate 3.3 -
i have class have class b list ... so, queryover have :
classb lb = null; var result = session.queryover<classa> .joinalias(x => x.listb, () => lb, jointype.leftouterjoin) .where(() => lb.property == 1) .list<classa>(); how can using nhibernate query<> ?
thanks
paul
assuming want list of classa having @ least 1 classb property == 1:
var result = session.query<classa>() .where(a => a.listb.any(b => b.property == 1)) .tolist(); this wouldn't outer join, though. might emulate adding || !a.listb.any().
Comments
Post a Comment