I map requests to responses based on requestId as follows:
public void MatchCallPairsByRequestId()
{
_callPairs = _requests.Where(req => !string.IsNullOrEmpty(req.RequestId))
.Join(_responses,
req => req.RequestId,
resp => resp.RequestId,
(req, resp) => new CallPair(req, resp)).ToList();
}
or in the LINQ expression:
_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();
Now I want to collect requests and answers that do not correspond to the function in a separate list called nonMatchedRequestsand nonMatchedResponses. How to use this query to collect the balance in a separate list?
source
share