【发布时间】:2011-06-15 18:12:56
【问题描述】:
我有以下问题
基本上我有下面的 2 个 sn-ps:
var contactAssociation =
session.QueryOver<ContactAssociation>(() => contactAssociationAlias)
.Where(() =>
contactAssociationAlias.Contact.ID == careGiverId &&
contactAssociationAlias.Client.ID == clientKey)
.Where(() =>
contactAssociationAlias.AclRole.RoleName == "Care Giver")
.SingleOrDefault();
和
var contactAssociation = session.Query<ContactAssociation>()
.Where(cr =>
cr.Contact.ID == careGiverId
&& cr.Client.ID == clientKey)
.Where(cr =>
cr.AclRole.RoleName == "Care Giver")
.SingleOrDefault();
第二个工作第一个输出此错误:
Message=could not resolve property: AclRole.RoleCode of:
SL.STAdmin.DAL.ContactAssociation
有人知道这是为什么吗? 提前谢谢你
【问题讨论】:
标签: c# nhibernate linq-to-nhibernate queryover