title: Save partial data (update) with Entity Framework
body: <p>So I'm trying to do an update to an Entity model but it's not going as well as I'd like. I'm only trying to update a few fields in my model, but when I have the following code run, I get a <code>SqlException</code> complaining that there are fields (that I'm not trying to edit) that do not allow nulls. It's seeming like it's trying to create a new row in the database, instead of just updating the existing one? Not too sure what to make of it. Any help would be appreciated.</p>
  
  <pre><code>[HttpPost]
  public ActionResult Budget(Proposal proposal)
  {
      if (ModelState.IsValid)
      {
          db.Proposals.Attach(proposal);
          db.ObjectStateManager.ChangeObjectState(proposal, EntityState.Modified);
          db.SaveChanges();
          return RedirectToAction("Details", new {id = proposal.ProposalID});
      }
  
      return View(proposal);
  }
  </code></pre>
  
  <p>Here's the <code>SqlException</code> that I'm getting: "System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'Ulid', table 'casurg2_dev2.dbo.Proposals'; column does not allow nulls. UPDATE fails.
  The statement has been terminated."</p>
  
  <p>And here's the view in question: <a href="http://pastie.org/7984222" rel="nofollow">http://pastie.org/7984222</a></p>