如何在LINQ中添加多个 喜欢
var retailTransactionDiscountTrans =
(from t1 in context.RETAILTRANSACTIONPAYMENTTRANS
join t2 in context.RETAILTRANSACTIONTABLEs
on t1.TRANSACTIONID equals t2.TRANSACTIONID && t1.STORE equals t2.STORE)....;
我只想在LINQ中为该连接包括其他ON。
答案 0 :(得分:2)
您可以为此使用anonymous type。像这样:
on new { t1.TRANSACTIONID, t1.STORE } equals new { t2.TRANSACTIONID, t2.STORE }