Hi
I’ve tried using JsConfig.With
to create a scope to include type info in the JSON string.
However it doesn’t seem to work. Should it?
The following .NET 8, SS 8.4.0 example demonstrates the problem. In this example every JSON string looks the same - none include the type info.
using ServiceStack.Text;
JsConfig.IncludeTypeInfo = false;
var cus = new Customer { Name = "Dave" };
Console.WriteLine(JsonSerializer.SerializeToString(cus));
using (JsConfig.With(new Config { IncludeTypeInfo = true }))
{
Console.WriteLine(JsonSerializer.SerializeToString(cus));
}
Console.WriteLine(JsonSerializer.SerializeToString(cus));
Console.ReadKey();
public class Customer
{
public string Name { get; set; }
}