Example #1
0
            internal static void Register <T, TSerializer>() where TSerializer : ITypeSerializer
            {
                Text.Json.JsonReader.InitAot <T>();
                Text.Json.JsonWriter.InitAot <T>();

                Text.Jsv.JsvReader.InitAot <T>();
                Text.Jsv.JsvWriter.InitAot <T>();

                var hold = new object[]
                {
                    new List <T>(),
                    new T[0],
                    new Dictionary <string, string>(),
                    new Dictionary <string, T>(),
                    new HashSet <T>(),
                };

                JsConfig <T> .ExcludeTypeInfo = false;

                var r1 = JsConfig <T> .OnDeserializedFn;
                var r2 = JsConfig <T> .HasDeserializeFn;
                var r3 = JsConfig <T> .SerializeFn;
                var r4 = JsConfig <T> .DeSerializeFn;
                var r5 = TypeConfig <T> .Properties;

                JsReader <TSerializer> .InitAot <T>();

                JsWriter <TSerializer> .InitAot <T>();
            }
Example #2
0
 static AotConfig()
 {
     jsonSerializer = new JsonTypeSerializer();
     jsvSerializer  = new JsvTypeSerializer();
     jsonReader     = new JsReader <JsonTypeSerializer>();
     jsonWriter     = new JsWriter <JsonTypeSerializer>();
     jsvReader      = new JsReader <JsvTypeSerializer>();
     jsvWriter      = new JsWriter <JsvTypeSerializer>();
 }
Example #3
0
 static JsonAotConfig()
 {
     serializer = new JsonTypeSerializer();
     reader     = new JsReader <JsonTypeSerializer>();
     writer     = new JsWriter <JsonTypeSerializer>();
 }