title: NewtonSoft SerializeObject ignores TypeNameHandling
body: <p>Following the <a href="https://www.newtonsoft.com/json/help/html/SerializeTypeNameHandling.htm" rel="nofollow noreferrer">official documentation</a>: </p>
  
  <pre><code>string jsonTypeNameAll = JsonConvert.SerializeObject(stockholder, Formatting.Indented, new JsonSerializerSettings
  {
      TypeNameHandling = TypeNameHandling.All
  });
  
  Console.WriteLine(jsonTypeNameAll);
  // {
  //   "$type": "Newtonsoft.Json.Samples.Stockholder, Newtonsoft.Json.Tests",
  //   "FullName": "Steve Stockholder",
  //   "Businesses": {
  //     "$type": "System.Collections.Generic.List`1[[Newtonsoft.Json.Samples.Business, Newtonsoft.Json.Tests]], mscorlib",
  //     "$values": [
  //       {
  //         "$type": "Newtonsoft.Json.Samples.Hotel, Newtonsoft.Json.Tests",
  //         "Stars": 4,
  //         "Name": "Hudson Hotel"
  //       }
  //     ]
  //   }
  // }
  </code></pre>
  
  <p>I have copy pasted this code. </p>
  
  <pre><code>    public static string Convert&lt;T&gt;(T cacheObject)
      {
          return JsonConvert.SerializeObject(cacheObject, Formatting.Indented, new JsonSerializerSettings
          {
              TypeNameHandling = TypeNameHandling.All
          });
      }
  </code></pre>
  
  <p>However, if I call it with <code>Convert(DateTime.Now)</code> , I get a serialized DateTime string, without the type included: </p>
  
  <p><a href="https://i.stack.imgur.com/A84xN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A84xN.png" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong?</p>