Пример #1
0
        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);
        }
Пример #2
0
 /// <summary>
 /// Gets the write function.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns>WriteObjectDelegate.</returns>
 public WriteObjectDelegate GetWriteFn <T>() => JsvWriter <T> .WriteFn();