我有一个linq查询
var query = from record in session.Query<Record>()
from brwSet in session.Query<BorrowerSet>()
from brw in session.Query<Borrower>()
where
brw.PrintOrder == 1 && brwSet.PrintOrder == 0
&& record.Package.BorrowerSet.Contains( brwSet )
&& brwSet.Borrower.Contains( brw )
select new Summary()
{
BorrowerFirstName = brw.Contact.FirstName,
BorrowerLastName = brw.Contact.LastName,
LoanPackageID = record.Id
};
我怎么能重写这个以消除条款中的额外内容
from brwSet in session.Query<BorrowerSet>()
from brw in session.Query<Borrower>()
我怎样才能重写这个,所以我不需要这些集合上的contains函数?
record.Package.BorrowerSet.Contains( brwSet ) && brwSet.Borrower.Contains( brw )
答案 0 :(得分:0)
此查询没有包含。
var query =
from record in session.Query<Record>()
from brwSet in record.Package.BorrowerSet
where brwSet.PrintOrder == 0
from brw is brwSet.Borrowers
where brw.PrintOrder == 1
select new Summary()
{
BorrowerFirstName = brw.Contact.FirstName,
BorrowerLastName = brw.Contact.LastName,
LoanPackageID = record.Id
};