title: ASP.NET MVC display property from other model in view
body: <p>First of all sorry for that lame naming, but I didn't know how to correctly ask my question. </p>
  
  <p>The point is: I have an ASP.NET MVC application written in C# and I have two model classes - <code>Song</code> and <code>Genre</code>. </p>
  
  <p>In the <code>Song</code> model class, I have a property <code>GenreId</code> which points to property <code>Id</code> of the <code>Genre</code> model class. </p>
  
  <p>In the generated viev for <code>Song</code> (which is meant to display song titles with artist and genre names) I have the line with following HTML helper: </p>
  
  <pre><code>@Html.DisplayFor(modelItem =&gt; item.GenreId)
  </code></pre>
  
  <p>Which obviously displays the <code>GenreID</code>, not the name of the genre. </p>
  
  <p>But how I am suppose to say this HTML helper "display <code>Genre.Name</code> which has the same <code>Genre.Id</code> as <code>item.GenreId</code> ?</p>
  
  <p>I know that to make list of the genres available in view, I have to add the following line:</p>
  
  <pre><code>ViewBag.Genres = db.Genres.ToList();
  </code></pre>
  
  <p>In the controller action which returns the view, but how to make it use it that way I described?</p>