当我试图用nhibernate获取集合时,我得到了这个异常
NHibernate.QueryException:'无法解析属性:PartyTags: Acts.Core.Entities.Parties [。凡[Acts.Core.Entities.Parties](NHibernate.Linq.NhQueryable`1 [Acts.Core.Entities.Parties] 引用((x,)=>(。所有[Acts.Core.Entities.PartyTags](x.PartyTags,(p,) => (等于(p.Id,p1)),))),)]'
获取方法
var Parties = session.Query<Parties>().Where(x => x.PartyTags.All(p=>p.Id==48)).ToList();
映射
缔约方
Id(x => x.Party_id);
Map(x => x.Work_place);
HasMany(x=>x.PartyTags).KeyColumn("Party_id")
.PropertyRef("Party_id");
Partytags
Table("PARTY_TAGS");
Id(x => x.Id);
Map(x => x.Party_id);
Map(x => x.Option_id);
db上没有外键。