title: MVC 4 Razor - Display name from dictionary using DisplayFor instead of ID
body: <p>I'm using MVC4 Razor to render a simple web page and would like to know if there is an easy way to render a "translated" value using DisplayFor instead of displaying the model's ID value.</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>public class Property
  {
      [Key]
      public int Rec_Id { get; set; }
      public string Name  { get; set; }
      public int TypeId  { get; set; }
  }
  
  public class Type
  {
      public int TypeId  { get; set; }
      public string TypeName  { get; set; }
  }
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public ActionResult Index()
  {
      PropertyContext db = new PropertyContext();
      Property model = db.Property.Find(94284);
      ViewBag.cmbType = db.Type.ToList();
      return View(model);
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;div class="display-field"&gt;
      @Html.DisplayFor(ViewBag.Type =&gt; ViewBag.Type.Find(model.Type).TypeName)
  &lt;/div&gt;
  </code></pre>