Beispiel #1
0
 internal static PrimitiveType FromKind(DataKind kind)
 {
     if (kind == DataKind.TX)
     {
         return(TextType.Instance);
     }
     if (kind == DataKind.BL)
     {
         return(BoolType.Instance);
     }
     if (kind == DataKind.TS)
     {
         return(TimeSpanType.Instance);
     }
     if (kind == DataKind.DT)
     {
         return(DateTimeType.Instance);
     }
     if (kind == DataKind.DZ)
     {
         return(DateTimeOffsetType.Instance);
     }
     return(NumberType.FromKind(kind));
 }
Beispiel #2
0
 internal static PrimitiveType FromType(Type type)
 {
     if (type == typeof(ReadOnlyMemory <char>))
     {
         return(TextType.Instance);
     }
     if (type == typeof(bool))
     {
         return(BoolType.Instance);
     }
     if (type == typeof(TimeSpan))
     {
         return(TimeSpanType.Instance);
     }
     if (type == typeof(DateTime))
     {
         return(DateTimeType.Instance);
     }
     if (type == typeof(DateTimeOffset))
     {
         return(DateTimeOffsetType.Instance);
     }
     return(NumberType.FromType(type));
 }