Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Start AOT config

  • Loading branch information...
commit 8307b5a032f40300fda721a519d32201cc532e7a 1 parent 2d33196
@mythz mythz authored
View
23 src/ServiceStack.Text/JsConfig.cs
@@ -1,4 +1,7 @@
using System;
+using ServiceStack.Text.Common;
+using ServiceStack.Text.Json;
+using ServiceStack.Text.Jsv;
namespace ServiceStack.Text
{
@@ -9,5 +12,25 @@ public static class JsConfig
[ThreadStatic]
public static bool IncludeNullValues = false;
+
+ /// <summary>
+ /// Registers for AOT.
+ /// </summary>
+ public static void RegisterForAot<T>()
+ {
+ JsonAotConfig.Instance.Register<T>();
+ }
+ }
+
+ public class JsonAotConfig
+ {
+ public static JsonAotConfig Instance = new JsonAotConfig();
+
+ public void Register<T>()
+ {
+ int i=0;
+ DeserializeArrayWithElements<T, JsonTypeSerializer>.ParseGenericArray(null, null);
+ if (DeserializeArray<T, TSerializer>.Parse != null) i++;
+ }
}
}
View
BIN  src/ServiceStack.Text/ServiceStack.Text.pidb
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.