title: How do you Add or Update a JProperty Value in a JObject
body: <p>I am currently using the following extension method to perform this task, but it almost seems like there should be some existing included method or extension to perform this (or at least a subset of this). If there isn't anything within <strong>Json.NET</strong> then what is the recommended process, or how would I change the code below to be closer to the recommended process.</p>
  
  <pre><code>public static partial class ExtensionMethods
  {
      public static JObject SetPropertyContent(this JObject source, string name, object content)
      {
          var prop = source.Property(name);
  
          if (prop == null)
          {
              prop = new JProperty(name, content);
  
              source.Add(prop);
          }
          else
          {
              prop.Value = JContainer.FromObject(content);
          }
  
          return source;
      }
  }
  </code></pre>
  
  <p>I can confirm the above code works for basic usage, but I'm not certain how well it holds up to broader usage. </p>
  
  <p>The reason I have this extension returning a <code>JObject</code> is so that you would be able to chain calls (either multiple calls to this extension or to other methods and extensions).</p>
  
  <p>i.e.,</p>
  
  <pre><code>var data = JObject.Parse("{ 'str1': 'test1' }");
  
  data
      .SetPropertyContent("str1", "test2")
      .SetPropertyContent("str3", "test3");
  
  // {
  //   "str1": "test2",
  //   "str3": "test3"
  // }
  </code></pre>