public static TDestination?ConvertTo <TSource, TDestination>(TSource source) where TDestination : struct { if (typeof(TSource) == typeof(DBNull)) { return(null); } if (source == null) { return(null); } return(XConvert <TSource, TDestination> .Convert(source)); }
private static bool IsSequence <T>(CaseInfo <T>[] cases, out T offset) { if (cases.Length > 0) { offset = cases[0].Value; for (uint i = 0; i < cases.Length; i++) { if (XConvert <long> .Convert(offset) + i != XConvert <long> .Convert(cases[i].Value)) { return(false); } } return(true); } offset = default; return(false); }
public override TDestination Convert <TDestination>(object value) => XConvert <TDestination> .Convert((TSource)value);
public static TDestination Convert <TSource, TDestination>(TSource source) { return(XConvert <TSource, TDestination> .Convert(source)); }
public override object Convert <TSource>(TSource value) => XConvert <TDestination> .Convert(value);