title: serializing only parts of an object with json
body: <p>I have an object called MyObject that has several properties. MyList is a list of MyObject that I populate with a linq query and then I serialize MyList into json. I end up with something like this</p>
  
  <pre><code>    List&lt;MyObject&gt; MyList = new List&lt;MyObject&gt;();
  
      MyList = TheLinqQuery(TheParam);
  
      var TheJson = new System.Web.Script.Serialization.JavaScriptSerializer();
      string MyJson = TheJson.Serialize(MyList);
  </code></pre>
  
  <p>What I want to do is serialize only parts of MyObject. For instance, I might have Property1, Property2...Propertyn and I want MyJson to only include Property3, Property5 and Property8.</p>
  
  <p>I thought of a way to do this by creating a new object with only the properties I want and from there create a new list for the serialization. Is this the best way or is there a better/faster way?</p>
  
  <p>Thanks. </p>