c# - Fetch first element from a collection -
i'm trying first element collection , i'm getting error :
a fetch request must simple member access expression; '[100002]' subqueryexpression instead. parameter name: relatedobjectselector.
my query :
var allconferences = session.query<conferencedao>() .fetch(i => i.incident) .thenfetch(s => s.sheets.firstordefault()) //here need first sheet .thenfetch(v => v.victims) .projectto<telephonyconference>();
i've tried :
var subq = queryover.of<incidentdao>().selectlist(x => x.selectmin(y => y.sheets)); var allconferences = session.queryover<conferencedao>() .fetch(i => i.incident).eager .withsubquery.whereproperty(x => x.incidentid).in(subq) .list() .asqueryable() .fetch(b=>b.victims) .fetch(a => a.agency) .projectto<telephonyconference>(); return allconferences;
but i'm getting error :
"there no method 'fetch' on type 'nhibernate.linq.eagerfetchingextensionmethods' matches specified arguments"
any idea how can solve this? thanks
Comments
Post a Comment