Avoiding for loops to bring table related information for grid display
<p>I have the following database schema for which I am developing the screen for it.</p>

<p><a href="https://i.stack.imgur.com/EnTtr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EnTtr.png" alt="enter image description here"></a></p>

<p>I want to display the information in a grid ,for example Desc should be repeated in more than one row and for each row there has to be columns from
<strong>tableC,tableB and tableA</strong> related information.</p>

<p>Right now I am getting every table in  the controller layer using linq "<strong>Include</strong>" related entities and using many foreach loops I am getting the customTable class created and then binding it to the kendo grid.</p>

<pre><code>foreach(var a in table C)
{
 foreach(var b in tableB)
 {
   CustomTable c = new CustomTable {
   tableDesc = b.Desc,
   tableBDesc = a.Desc
 }
  }
}

class CustomTable
{
  public string tableDDesc{get;set;}
  public string tableBDesc {get;set;}
}
</code></pre>

<p>I am thinking is there any better approach for this /Linq syntax to build the customClass in Data access layer itself. Any inputs please?</p>