title: MVC Create returns null object
body: <p>I'm having a problem in my MVC project. When trying to create an object to add it to the db, it always returns null.</p>
  
  <pre><code>public class ListsModel
  {
      public EntitiesList EntityList { get; set; }
      public List&lt;string&gt; AllGroups { get; set; }
  }
  
      public ActionResult Create()
      {
          ListsModel model = new ListsModel();
          model.EntityList = new EntitiesList();
          model.AllGroups = managerLists.GetAllListsKeys(); //For droplist
  
          return View(model);
      }
  
      [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Create(ListsModel model)
      {
          if (ModelState.IsValid)
          {
              model.EntityList.List_CreatedTime = DateTime.Now;
              managerLists.AddNewObject(model.EntityList);
              return RedirectToAction("Index");
          }
  
          return View(model);
      }
  </code></pre>
  
  <p>And a simple  cshtml:</p>
  
  <pre><code>@using (Html.BeginForm())
  {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true)
  
      &lt;fieldset&gt;
          &lt;legend&gt;EntitiesList&lt;/legend&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.EntityList.List_EntitityName)
              @Html.DropDownListFor(model =&gt; model.AllGroups, new SelectList(Model.AllGroups),
                                      new { @class = "form-control" })
              &lt;p class="help-block"&gt;@Html.ValidationMessageFor(model =&gt; model.EntityList.List_EntitityName)&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.EntityList.List_EntityValue)
              &lt;input class="form-control" value="@Model.EntityList.List_EntityValue"/&gt;
              &lt;p class="help-block"&gt;@Html.ValidationMessageFor(model =&gt; model.EntityList.List_EntityValue)&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.EntityList.List_OrderByNumber)
              &lt;input class="form-control" value="@Model.EntityList.List_OrderByNumber"/&gt;
              &lt;p class="help-block"&gt;@Html.ValidationMessageFor(model =&gt; model.EntityList.List_OrderByNumber)&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              @Html.LabelFor(model =&gt; model.EntityList.List_Comments)
              &lt;textarea class="form-control" rows="3"&gt;@Model.EntityList.List_Comments&lt;/textarea&gt;
              &lt;p class="help-block"&gt;@Html.ValidationMessageFor(model =&gt; model.EntityList.List_Comments)&lt;/p&gt;
          &lt;/div&gt;
  
          &lt;p&gt;
              &lt;input type="submit" value="Create" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p>When it's getting to the "model.EntityList.List_CreatedTime = DateTime.Now;" a null reference exception is thrown.</p>
  
  <p>I tried to change the signature to "public ActionResult Create(ListsModel ListsModel)", as suggested here: <a href="https://stackoverflow.com/questions/3447672/create-view-is-posting-null-objects">Create view is posting null objects</a>
  But I got the same results.</p>
  
  <p>Hope you can help me.</p>