using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
public static void Main()
var thing = new Thing {Name = "woo", Id=1234, Timestamp = DateTimeOffset.UtcNow};
thing.AnotherThing = new Thing2() {Name = "WEWWEWEWEWE"};
var jsonSerializerSettings = new JsonSerializerSettings() {
TypeNameHandling = TypeNameHandling.All,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
StringEscapeHandling = StringEscapeHandling.EscapeHtml,
TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple
var json = JsonConvert.SerializeObject(thing, Formatting.None, jsonSerializerSettings);
public string Name {get; set;}
public int Id {get; set;}
public DateTimeOffset Timestamp {get; set;}
public Thing TheThing {get; set;}
public Thing2 AnotherThing {get; set;}
public string Name {get; set;}