0
我有以下表現:如何將linq表達式與連接轉換爲lambda表達式?
_callPairs = (from req in _requests
join resp in _responses
on req.RequestId equals resp.RequestId
where !string.IsNullOrEmpty(req.RequestId)
select new CallPair(req, resp)).ToList();
,我想換拉姆達。我試過了:
_callPairs = _requests.Where(req => (_responses.Where(res => res.RequestId ==
req.RequestId)).Where(!string.IsNullOrEmpty(req.RequestId)).ToList();
不幸的是,這不能編譯。
有人可以向我解釋我如何將linq表達式與連接轉換爲lambda表達式?