Permalink
Browse files

Start AOT config

  • Loading branch information...
1 parent 2d33196 commit 8307b5a032f40300fda721a519d32201cc532e7a @mythz mythz committed May 4, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/ServiceStack.Text/JsConfig.cs
  2. BIN src/ServiceStack.Text/ServiceStack.Text.pidb
@@ -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++;
+ }
}
}
Binary file not shown.

0 comments on commit 8307b5a

Please sign in to comment.