Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal bool IsValidValue(string v, CultureInfo culture = null) =>
- //Changes to these should also result in changes to CsvDataTableReader:ctor
- Type == CsvColumnType.DateTime ?
- DateTime.TryParseExact(v, Format, null, DateTimeStyles.None, out var _) :
- Type == CsvColumnType.Period ?
- Format is not null ? TimeSpan.TryParseExact(v, Format, null, out var _) :
- culture is not null ? TimeSpan.TryParse(v, culture, out var _) :
- TimeSpan.TryParse(v, out var _) :
- Type == CsvColumnType.Float ?
- culture is not null ? Double.TryParse(v, culture, out var _) :
- Double.TryParse(v, out var _) :
- Type == CsvColumnType.Decimal ?
- culture is not null ? Decimal.TryParse(v, culture, out var _) :
- Decimal.TryParse(v, out var _) :
- Type == CsvColumnType.Integer ?
- culture is not null ? Int64.TryParse(v, culture, out var _) :
- Int64.TryParse(v, out var _) :
- true;
- public Type NullableReflectedType =>
- !Nullable ?
- ReflectedType :
- Type == ColumnDataType.Boolean ? typeof(bool?) :
- Type == ColumnDataType.Decimal ? typeof(decimal?) :
- Type == ColumnDataType.Float ?
- NumberType == SegmentDataType.Float32 ? typeof(float?) :
- NumberType == SegmentDataType.Float64 ? typeof(double?) :
- throw new Exception($"Invalid Number Type ({NumberType}) for Float") :
- Type == ColumnDataType.Guid ? typeof(Guid?) :
- Type == ColumnDataType.Integer ?
- NumberType == SegmentDataType.Int8 ? typeof(sbyte?) :
- NumberType == SegmentDataType.Int16 ? typeof(short?) :
- NumberType == SegmentDataType.Int32 ? typeof(int?) :
- NumberType == SegmentDataType.Int64 ? typeof(long?) :
- NumberType == SegmentDataType.Int128 ? typeof(Int128?) :
- NumberType == SegmentDataType.UInt8 ? typeof(byte?) :
- NumberType == SegmentDataType.UInt16 ? typeof(ushort?) :
- NumberType == SegmentDataType.UInt32 ? typeof(uint?) :
- NumberType == SegmentDataType.UInt64 ? typeof(ulong?) :
- NumberType == SegmentDataType.UInt128 ? typeof(UInt128?) :
- throw new Exception($"Invalid Number Type ({NumberType}) for Number") :
- Type == ColumnDataType.String ? typeof(string) :
- Type == ColumnDataType.TimeSpan ? typeof(TimeSpan?) :
- Type == ColumnDataType.TimeStamp ? typeof(DateTime?) :
- throw new NotImplementedException(Type.ToString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement