title: Object property is NULL, in MVC Edit action
body: <p>Using below models</p>
  
  <pre><code>public class State
  {
      public int StateId { get; set; }
      public string Code { get; set; }
      public string Name { get; set; }
  }
  
  public class City
  {
      public int CityId { get; set; }
      public string Name { get; set; }
      public State state { get; set; }
  }
  </code></pre>
  
  <p>and following View</p>
  
  <pre><code>@using (Html.BeginForm())
  {
      @Html.AntiForgeryToken()
  
      &lt;div class="form-horizontal"&gt;
          &lt;h4&gt;City&lt;/h4&gt;
          &lt;hr /&gt;
          @Html.ValidationSummary(true, "", new { @class = "text-danger" })
          @Html.HiddenFor(model =&gt; model.CityId)
          @Html.HiddenFor(model =&gt; model.state.StateId)
          @Html.HiddenFor(model =&gt; model.state.Name)
          @Html.HiddenFor(model =&gt; model.state.Code)
  
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
              &lt;div class="col-md-10"&gt;
                  @Html.EditorFor(model =&gt; model.Name, new { htmlAttributes = new { @class = "form-control" } })
                  @Html.ValidationMessageFor(model =&gt; model.Name, "", new { @class = "text-danger" })
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-offset-2 col-md-10"&gt;
                  &lt;input type="submit" value="Save" class="btn btn-default" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>I see the <code>State</code> is <code>NULL</code> in my controller</p>
  
  <pre><code>public ActionResult Edit([Bind(Include = "CityId,Name")] City city)
  {
      // City.State is NULL and ModelSAtate.IsValid is FALSE
      if (ModelState.IsValid)
      {
          db.Entry(city).State = EntityState.Modified;
          db.SaveChanges();
          return RedirectToAction("Index");
      }
      return View(city);
  }
  </code></pre>
  
  <p>By this mean, <code>City.State</code> is <code>NULL</code>.</p>
  
  <p>I know the workaround to make <code>ModelState.IsValid</code> to <code>TRUE</code> but I like to know the right way for hanlding object property in MVC View.</p>