title: ASP MVC Edit Post Function has null Parameter
body: <p>I'm trying to create a very basic MVC app based on a tutorial.  I am using the default routing, and simple Views and Model.</p>
  
  <p>The problem I am having is with the HttpPost Edit function.  I am expecting an object of my "MyObject" type to be passed as the parameter, but it always comes back null.</p>
  
  <p>Here are my Edit functions from the controller (the Get function works properly):</p>
  
  <pre><code>public ActionResult Edit(int? id)
  {
      if (!id.HasValue)
          return RedirectToAction("Index");
  
      var item = (from obj in mDB.MyDatabaseObjects
                  where obj.Id == id
                  select obj).First();
      return View(item);
  }
  
  //
  // POST: /Main/Edit/5
  
  [HttpPost]
  public ActionResult Edit(MyDatabaseObject someObject)
  {
      var original = (from obj in mDB.MyDatabaseObjects
                      where obj.Id == someObject.Id
                      select obj).First();
  
      if (!ModelState.IsValid)
          return View(original);
  
      mDB.ApplyCurrentValues(original.EntityKey.EntitySetName, someObject);
      mDB.SaveChanges();
  
      return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>Note that my (nearly identical) Create method works as expected:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Create([Bind(Exclude="Id")] MyDatabaseObject newObject)
  {
      if (!ModelState.IsValid)
          return View();
  
      int max = mDB.MyDatabaseObjects.Max(data =&gt; data.TaskOrder);
  
      newObject.TaskOrder = max + 1;
      mDB.AddToMyDatabaseObjects(newObject);
      mDB.SaveChanges();
  
      return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>Thanks,<br />
  wTs</p>