title: REST API save object updates to database
body: <p>I am writing a RESTful API (json) in C# using WCF 4.0. Data is stored in a SQL Server 2012 db. One available call will allow clients to save objects, something like this:</p>
  
  <pre><code>PUT /object/123
  
  {
  Subject: "my subject",
  Comment: "my comment"
  }
  </code></pre>
  
  <p>That far all is ok. But sometimes the client only wants to update one of the parameters in an object. Like this:</p>
  
  <pre><code>PUT /object/123
  
  {
  Comment: "I changed my comment"
  }
  </code></pre>
  
  <p>The question is: is there a best practice to make the update in the database table? How do I know what fields were supplied (given that some fields should be able to be null)? How do I write nice code that only update those columns that were supplied?</p>