C# nHibernate QueryOver<;T>;并发症

C# nHibernate QueryOver<;T>;并发症,c#,nhibernate,lambda,queryover,C#,Nhibernate,Lambda,Queryover,我有以下表格: 客户=>CustomerAccount=>Account 我有一个nHibernate映射POCO到上面的每个表 我在一个实现IIdentifier 谢谢 凯尔你可以试试: var query = QueryOver(() => account) .JoinAlias(() => account.CustomerAccounts, () => customerAccount, JoinType.InnerJoin) .JoinAlias(() =

我有以下表格:

客户=>CustomerAccount=>Account

我有一个nHibernate映射POCO到上面的每个表

我在一个实现
IIdentifier

谢谢

凯尔

你可以试试:

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(Restrictions.Where<ICustomer>(Filter));
var query=QueryOver(()=>account)
.JoinAlias(()=>account.CustomerAccounts,()=>customerAccount,JoinType.InnerJoin)
.JoinAlias(()=>customerAccount.Customer,()=>Customer,JoinType.InnerJoin)
.Where(()=>customerAccount.EndDate==null)
.和(()=>account.IsPreferredAccount==true)
.和(限制条件,其中(过滤器));
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);
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(Restrictions.Where<ICustomer>(Filter));