internal static string ToTimeTZ(NpgsqlNativeTypeInfo typeInfo, object nativeData, Boolean ForExtendedQuery)
        {
            if (nativeData is DateTime)
            {
                return(BasicNativeToBackendTypeConverter.ToTime(typeInfo, nativeData, ForExtendedQuery));
            }
            NpgsqlTimeTZ time;

            if (nativeData is TimeSpan)
            {
                time = (NpgsqlTimeTZ)(TimeSpan)nativeData;
            }
            else
            {
                time = (NpgsqlTimeTZ)nativeData;
            }
            return(time.ToString());
        }
Ejemplo n.º 2
0
        internal static byte[] ToTimeTZ(NpgsqlNativeTypeInfo typeInfo, object nativeData, Boolean forExtendedQuery, NativeToBackendTypeConverterOptions options, bool arrayElement)
        {
            if (nativeData is DateTime)
            {
                return(BasicNativeToBackendTypeConverter.ToTime(typeInfo, nativeData, forExtendedQuery, options, arrayElement));
            }
            NpgsqlTimeTZ time;

            if (nativeData is TimeSpan)
            {
                time = (NpgsqlTimeTZ)(TimeSpan)nativeData;
            }
            else
            {
                time = (NpgsqlTimeTZ)nativeData;
            }
            return(BackendEncoding.UTF8Encoding.GetBytes(time.ToString()));
        }