Instead of converting string to object, now it can convert any known type to object
here is an example with result {"$types":{"ConsoleApp8.Test":"1"},"$type":"1","custom":3}
using System;
using System.Diagnostics;
using System.IO;
using fastJSON;
namespace ConsoleApp8
{
class Program
{
static void Main(string[] args)
{
JSON.RegisterCustomType<CustomType, int>(a => a.value, a => new CustomType() { value = a });
var json = Serializer.Serialize(new Test() { custom = new CustomType() { value = 3 } });
Console.WriteLine(json);
var t = Serializer.Deserialize<Test>(json);
Debug.Assert(t.custom.value == 3);
Console.ReadLine();
}
}
public struct CustomType
{
public int value;
}
public class Test
{
public CustomType custom = new CustomType();
}
}
Instead of converting string to object, now it can convert any known type to object
here is an example with result {"$types":{"ConsoleApp8.Test":"1"},"$type":"1","custom":3}