title: ASP.NET MVC join tables view result error
body: <p>im trying to join two table and show the results in a strongly-typed list view in  with columns from two tables,</p>
  
  <pre><code> public ActionResult OrderDetails(int id) {
          var query = from o in db.OrderDetails
                      join a in db.Albums on o.AlbumId equals a.AlbumId
                      where o.OrderId == id
                      select new OrderDetail() {
                          OrderId = o.OrderId,
                          AlbumId = o.AlbumId,
                          Quantity = o.Quantity,
                          UnitPrice = o.UnitPrice,
                          Album = new Album {
                              Title = a.Title
                          }
                      };
          return View(query);
      }
  </code></pre>
  
  <p>Here is my view</p>
  
  <pre><code> @model IEnumerable&lt;QWERK.OrderDetail&gt;
  
   @{
  ViewBag.Title = "OrderDetails";
   }
  
   &lt;h2&gt;OrderDetails&lt;/h2&gt;
  
   &lt;p&gt;
   @Html.ActionLink("Create New", "Create")
   &lt;/p&gt;
   &lt;table&gt;
       &lt;tr&gt;
           &lt;th&gt;
               @Html.DisplayNameFor(model =&gt; model.OrderId)
           &lt;/th&gt;
           &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.AlbumId)
      &lt;/th&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.Quantity)
      &lt;/th&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.UnitPrice)
      &lt;/th&gt;
      &lt;th&gt;&lt;/th&gt;
  &lt;/tr&gt;
  
   @foreach (var item in Model) {
  &lt;tr&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.OrderId)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.AlbumId)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.Quantity)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.UnitPrice)
      &lt;/td&gt;
       &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.Album.Title)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.ActionLink("Edit", "Edit", new { id=item.OrderDetailId }) |
          @Html.ActionLink("Details", "Details", new { id=item.OrderDetailId }) |
          @Html.ActionLink("Delete", "Delete", new { id=item.OrderDetailId })
      &lt;/td&gt;
  &lt;/tr&gt;
   }
  
   &lt;/table&gt;
  </code></pre>
  
  <p>But i keep getting a NotSupportedException</p>
  
  <p>Im pretty sure im getting the error because im using the OrderDetails Model but how can i get around this to show multiple columns from different tables???? any help would be greatly appreciated...thanks</p>