1
任何想法,爲什麼我可能會得到「沒有persister:System.Collections.Generic.List」異常時執行下面的查詢?Nhibernate:沒有persister for:System.Collections.Generic.List
var subs = new List<Subsection>();
var subsections = Session.QueryOver<Subsection>()
.WhereRestrictionOn(s => s.Id)
.IsInG(subsectionIds)
.List<Subsection>();
Location foreignExpertLocation = null;
var result = Session.QueryOver<InternationalLawyerExpertise>()
.JoinAlias(i => i.ForeignExpertLocation,() => foreignExpertLocation)
.JoinAlias(() => foreignExpertLocation.Subsections,() => subs)
.AndRestrictionOn(() => subs).IsInG(subsections)
.Where(i => i.ForeignExpertLocation == location && i.Status.Id == _confirmed)
.Fetch(lawyer => lawyer.PersonOrganisation.Person).Eager
.Fetch(lawyer => lawyer.PersonOrganisation.Organisation).Eager
.List<InternationalLawyerExpertise>();
return result;
我映射到一些表格不正確,但基本上是你的解決方案工作。 –