1
我有以下表:的nHibernate QueryOver <T>并发症
客户=> CustomerAccount =>帐户
我有一个的nHibernate映射到POCO每个表的以上为好。
我有一个实现IIdentifier<T>
public Expression<Func<ICustomer, bool>> Filter
{
get { return customer => customer.CustomerNumber == _customerNumber; }
}
现在我想要做的是通过QueryOver<Account>
加入客户=> CustomerAccount =>帐户表对象以下lambda表达式如何我是否添加上面的Filter
lamdba(客户类型)以按客户编号进行过滤?
ICustomer customer = null;
ICustomerAccount customerAccount = null;
IAccount account = null;
var query = QueryOver(() => account)
.JoinAlias(() => account.CustomerAccounts,() => customerAccount, JoinType.InnerJoin)
.JoinAlias(() => customerAccount.Customer,() => customer, JoinType.InnerJoin)
.Where(() => customerAccount.EndDate == null)
.And(() => account.IsPreferredAccount == true)
.And(() => ?? Want to add the above Filter() lambda some how here);
感谢,
凯尔