title: How to join multiple tables without using navigation properties in C#
body: <p>I have an <strong>ASP.NET MVC3</strong> application. </p>
  
  <p>In my application I have the following <strong>EF</strong> classes (<code>hasCauses</code> and <code>isOfProblems</code> are navigation properties):</p>
  
  <pre><code>Problem {string ProblemId, string ProblemName, string ProblemDesc, bool solved, hasCauses}
  Cause {string CauseId, string CauseName, string CauseDesc, isOfProblems}
  ProblemCause {string ProblemId, string CauseId}
  </code></pre>
  
  <p>My <strong>Repository</strong> methods just return EF objects (same method for cause)</p>
  
  <pre><code>IQueryable&lt;Problem&gt; GetProblemsById(string problemId)
  </code></pre>
  
  <p>Now in my <strong>Service</strong> layer I have to create an object <code>SolvedProblems</code> that has to contain, among other fields, ProblemId and CauseId and of course they have to be related(according to <code>ProblemCause</code>). From my <strong>Service</strong> Layer I cannot "see" <code>ProblemCause</code> table because I do not use the navigation properties (they are used just in <strong>Repository</strong>). Therefore, I can create a method:</p>
  
  <pre><code>IQueryable&lt;Cause&gt; GetProblemsByCauseId(string causeId)
  </code></pre>
  
  <p>And fill the <code>ProblemCause</code> while iterating through the <code>Problems</code>. However, if instead of two tables (+ association) I have 3 or more tables interconnected? Is it worth to make this nested cycles or to bring all the logic to the <strong>Repository</strong> (where can I use navigation properties) and return <code>SolvedProblems</code> to the <code>Service</code>?</p>