public T ReadValue(IValueReader valueReader) { if (valueReader is IValueReader <T> ) { return(((IValueReader <T>)valueReader).ReadValue()); } return(DConvert <T> .Convert(valueReader.DirectRead())); }
public T ReadValue(IValueReader valueReader) { if (valueReader is IValueReader <T> ) { return(((IValueReader <T>)valueReader).ReadValue()); } object directValue = valueReader.DirectRead(); if (directValue is T || directValue == null) { return((T)directValue); } return(DConvert <T> .Convert(directValue)); }
public T?ReadValue(IValueReader valueReader) { if (valueReader.GetBasicType() == BasicTypes.Null) { var directValue = valueReader.DirectRead(); if (directValue == null) { return(null); } return(DConvert <T> .Convert(directValue)); } return(ValueInterface <T> .Content.ReadValue(valueReader)); }
public TimeSpan ReadValue(IValueReader valueReader) { object directValue = valueReader.DirectRead(); if (directValue is TimeSpan) { return((TimeSpan)directValue); } if (directValue is string) { return(TimeSpan.Parse((string)directValue)); } return(DConvert <TimeSpan> .Convert(directValue)); }
public DateTimeOffset ReadValue(IValueReader valueReader) { if (valueReader is IValueReader <DateTimeOffset> dateTimeOffsetReader) { return(dateTimeOffsetReader.ReadValue()); } object directValue = valueReader.DirectRead(); if (directValue is DateTimeOffset) { return((DateTimeOffset)directValue); } if (directValue is string) { return(DateTimeOffset.Parse((string)directValue)); } return(DConvert <DateTimeOffset> .Convert(directValue)); }