title: Excluding a property from an update in the database using Entity Framework
body: <p>I have a put method in my MVC4 Web API like this:</p>
  
  <pre><code>public HttpResponseMessage PutUser(int id, User user)
  {
      if(!Modelstate.IsValid)
      {
          return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Modelstate invalid");
      }
      // etc...
  }
  </code></pre>
  
  <p>My User model looks like this:</p>
  
  <pre><code>public Class User
  {
      public int ID { get; set; }
      public string Password {
          set 
          { 
               PasswordHash = HashPassword(value);
          }
      }
      [Required]
      public string PasswordHash { get; set; }   
  }
  </code></pre>
  
  <p>Now when I call my put method my Modelstate is invalid because my PasswordHash is not set. I don't want to update the password, so naturally, I didn't set it. How do I get my Modelstate to be valid and to not update the password hash field? I tried excluding it with Bind(Exclude) and I tried including it the same way.</p>