public static bool RegisterTypeForAot <T>() { bool ret = false; try { JsonAotConfig.Register <T>(); int i = 0; if (JsvWriter <T> .WriteFn() != null && JsvReader <T> .GetParseFn() != null) { i++; } if (JsonWriter <T> .WriteFn() != null && JsonReader <T> .GetParseFn() != null) { i++; } if (QueryStringWriter <Poco> .WriteFn() != null) { i++; } CsvSerializer <T> .WriteFn(); CsvSerializer <T> .WriteObject(null, null); CsvWriter <T> .WriteObject(null, null); CsvWriter <T> .WriteObjectRow(null, null); ret = true; }catch (Exception) {} return(ret); }
public static void RegisterForAot() { JsonAotConfig.Register <Poco>(); RegisterElement <Poco, string>(); RegisterElement <Poco, bool>(); RegisterElement <Poco, char>(); RegisterElement <Poco, byte>(); RegisterElement <Poco, sbyte>(); RegisterElement <Poco, short>(); RegisterElement <Poco, ushort>(); RegisterElement <Poco, int>(); RegisterElement <Poco, uint>(); RegisterElement <Poco, long>(); RegisterElement <Poco, ulong>(); RegisterElement <Poco, float>(); RegisterElement <Poco, double>(); RegisterElement <Poco, decimal>(); RegisterElement <Poco, Guid>(); RegisterElement <Poco, DateTime>(); RegisterElement <Poco, TimeSpan>(); RegisterElement <Poco, bool?>(); RegisterElement <Poco, char?>(); RegisterElement <Poco, byte?>(); RegisterElement <Poco, sbyte?>(); RegisterElement <Poco, short?>(); RegisterElement <Poco, ushort?>(); RegisterElement <Poco, int?>(); RegisterElement <Poco, uint?>(); RegisterElement <Poco, long?>(); RegisterElement <Poco, ulong?>(); RegisterElement <Poco, float?>(); RegisterElement <Poco, double?>(); RegisterElement <Poco, decimal?>(); RegisterElement <Poco, Guid?>(); RegisterElement <Poco, DateTime?>(); RegisterElement <Poco, TimeSpan?>(); RegisterQueryStringWriter(); RegisterCsvSerializer(); }
public static void RegisterElement <T, TElement>() { JsonAotConfig.RegisterElement <T, TElement>(); }