6
我有以下問題
基本上我有以下2段:NHibernate的無法解析屬性例外,適用於QueryAll
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
有誰知道這是爲什麼? 預先感謝您