static void Main(string[] args) { var faker = new Faker(); DTO1 obj = faker.Create <DTO1>(); ISerialize serializer = new TJsonSerializer(); byte[] arr; Console.Out.Write(Encoding.UTF8.GetChars(serializer.Serialize(obj).ToArray())); Console.ReadKey(); }
static void Main(string[] args) { Tracer tracer = new Tracer(); tracer.StartTrace(); AnyClass anyObject = new AnyClass(tracer); anyObject.AnyMethod(); tracer.StopTrace(); tracer.GetTraceResult().threads[0].Id = 0; var writer = new TWriter(); { var formatter = new TXmlSerializer(); writer.WriteToConsole(formatter.Serialize(tracer.GetTraceResult())); writer.WriteToFile(formatter.Serialize(tracer.GetTraceResult()), "XmlTrace.XML"); } { var formatter = new TJsonSerializer(); writer.WriteToConsole(formatter.Serialize(tracer.GetTraceResult())); writer.WriteToFile(formatter.Serialize(tracer.GetTraceResult()), "JsonTrace.json"); } Console.ReadKey(); }