title: Update SQL Database with JSON
body: <p>I'm receiving a JSON result in my ASP webapi SaveChanges action. I want to take that JSON string and convert it to an SQL Update string. </p>
  
  <p>Just wondering if anyone knows what the best way to convert a JSON string to an SQL Update Query. </p>
  
  <p>Here is an example of the JSON string I am receiving and the equivalent SQL:</p>
  
  <pre><code>[{"ContactID":3,"FirstName":"Tester","LastName":"Tester","DepartmentName":"Dept"}]
  </code></pre>
  
  <p>Which would equate to:</p>
  
  <pre><code>UPDATE Contact Set FirstName = 'Tester', LastName = 'Tester', DepartmentName = 'Dept' Where ContactID = 3
  </code></pre>
  
  <p>Currently I'm doing a pretty nasty for loop on a JArray to build the SQL update string. So if anyone has any other cleaner methods that would be great.</p>