title: How to add multiple conditions in LINQ join using method syntax
body: <p>I need to add multiple condition on joins. In the below LINQ I need to add condition something like this. And need to use values from different entities in those conditions. And this needs to be done using this <strong>Method syntax only</strong>. I was able to do it in query syntax. But the requirement is that behind the scene it should generate one query or as less query as possible. The query syntax using multiple &quot;from&quot; or multiple &quot;join&quot; executes multiple SELECT queries.</p>
  <p>My second issue is that on the commented out line I need to filter on r4.VersionNo==r3.VersionNo. It's failing.</p>
  <p>, ppp =&gt; ppp.r2.KeyColumn, <strong>t =&gt; t.KeyColumn &amp;&amp; t.MyID==r1.MyID &amp;&amp; t.Column2==r2.Column2</strong>, (ppp, t) =&gt; new { ppp, t })</p>
  <p>Tried (didn't work):</p>
  <ul>
  <li>, ppp =&gt; ppp.r2.KeyColumn, <strong>t =&gt; (t.KeyColumn, t.MyID, t.Column2)</strong>, (ppp, t) =&gt; new { ppp, t })</li>
  </ul>
  <p>Code:</p>
  <pre><code>var result = repo1.Join(repo2, r1 =&gt; r1.KeyColumn, r2 =&gt; r2.KeyColumn, (r1, r2) =&gt; new { r1, r2 })
                   .Join(repo3, ppp =&gt; ppp.r2.KeyColumn, t =&gt; t.KeyColumn, (ppp, t) =&gt; new { ppp, t })
                   .Join(repo4, pppt =&gt; pppt.ppp.r2.KeyColumn, r4 =&gt; r4.VersionNo, (pppt, r4) =&gt; new { pppt, r4 })
                   .Select(a =&gt; new MyObject
                      {
                          KeyColumn = a.ppp.r1.KeyColumn,
                          AnotherKeyColumn = a.ppp.r2.AnotherKeyColumn,
                   })?.ToList();
  </code></pre>