title: Displaying data from multiple tables in a view as a list - ASP.Net MVC
body: <p>I have the following two tables (basic outline):</p>
  
  <p>Tbl_CategoryType</p>
  
  <p>ID
  LevelID
  Description</p>
  
  <p>Tbl_Levels
  ID
  Name</p>
  
  <p>Basically, I want to present all of the information in the Tbl_CategoryType table while referencing the Tbl_Levels.Name data based on the Tbl_CategoryType.LevelID number.</p>
  
  <p>I have tried using a join in my repository as below;</p>
  
  <pre><code>public IQueryable GetAllTypesInCategory(int CatID)
  {
       return (from x in DBEntities.LU_LST_CategoryTypeSet
               where x.CategoryID == CatID &amp;&amp; x.Enabled == 1
               join y in DBEntities.LU_LST_LevelSet on x.LevelID equals y.ID
               select new {x, y});
  }
  </code></pre>
  
  <p>However, when I call that method there is no type I can assign it to as it doesn't fit into the type of either the Category or Level.</p>
  
  <p>I'm assuming I need to do this through a custom viewmodel but can't figure out the steps.</p>
  
  <p>Thanks in advance</p>