title: ASP.NET MVC4 with EF 6 Model Update Issue
body: <p>I have two models as below</p>
  
  <pre><code>public class Category
  {
       [Key]
       [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
       public int ID { get; set; },
       [Required]
       public string category { get; set; }
       [Required]
       public string Desc { get; set; }
  }
  public class Product
  {
       [Key]
       [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
       public int ID { get; set; },
       public int CatID { get; set; },
       [ForeignKey("CatID")]
       public virtual Category Category { get; set; },
       [Required]
       public string Desc { get; set; },
       public string DisplayName
       {
           get
           {
               return string.format("{0} - {1}",this.Category.category,this.Desc);
           }
       }
  }
  </code></pre>
  
  <p>This is my Edit Action</p>
  
  <pre><code>public ActionResult Edit(int id)
  {
       ViewBag.PossibleCategories = categoryRepository.All;
       return View(productRepository.Find(id));
  }
  [HttpPost]
  public ActionResult Edit(Product product)
  {
       if (ModelState.IsValid)  //&lt;== This becomes false saying category.desc is required
       {
            productRepository.InsertOrUpdate(product);
            productRepository.Save();          
            return RedirectToAction("Index");
       }
       else
       {
            ViewBag.PossibleCategories = categoryRepository.All;
            return View();
       }
  }
  </code></pre>
  
  <p>I have a scaffolded a Edit view of product and it shows ID and DisplayName as Readonly. All the other fields a editable.</p>
  
  <p>The edit view also has the product -> category -> category has a read-only text field</p>
  
  <pre><code>@Html.TextBoxFor(model =&gt; model.Category.category, new Dictionary&lt;string, object&gt;() { { "readonly", "true" } })
  </code></pre>
  
  <p>The Post back sends this and tries to create a new category. This is not required. The category link will be carried forward using the product.CatID.</p>
  
  <p>How can i display these types of fields??</p>
  
  <p><strike>
  When the Edit view Post back the Model state appears as invalid because the product's category's desc is null (product -> category -> desc). 
  if i comment out the DisplayName property in Product this issue doesn't occur.</p>
  
  <p>From my understanding, this is because the DiaplayName property refers to Category property and the view view doesn't have category.desc field so when the model is created back on the POST action, the desc is not populated. Adding the category.desc field to the view is one way of solving this problem. 
  Is there any other method to solve this?</p>
  
  <p>Note: This is not the only model i'm having this issue. There are many complex models which have the same problem and to me having these fields also included in the view would make for (1) a very cluttered view (2) the amount of data making the round trip will be high.</strike></p>