private static string GetTypeName(SqlTypeCode typeCode) { if (!IsPrimitive(typeCode)) { throw new ArgumentException($"The type with code {typeCode} is not primitive"); } switch (typeCode) { case SqlTypeCode.LongVarChar: return("LONG VARCHAR"); case SqlTypeCode.LongVarBinary: return("LONG VARBINARY"); case SqlTypeCode.YearToMonth: return("YEAR TO MONTH"); case SqlTypeCode.DayToSecond: return("DAY TO SECOND"); default: return(typeCode.ToString().ToUpperInvariant()); } }
private string DateErrorMessage(string str, SqlTypeCode sqlType, string[] formats) { return(String.Format("The input string {0} of type {1} is not compatible with any of the formats for SQL Type {2} ( {3} )", str, TypeCode.ToString().ToUpperInvariant(), sqlType.ToString().ToUpperInvariant(), String.Join(", ", formats))); }
public TypeResolveContext(SqlTypeCode typeCode) : this(typeCode, typeCode.ToString().ToUpperInvariant()) { }
private static void AssertIsInterval(SqlTypeCode sqlType) { if (!IsIntervalType(sqlType)) { throw new ArgumentException(String.Format("SQL Type {0} is not a valid INTERVAL.", sqlType.ToString().ToUpperInvariant())); } }
private static void AssertIsInterval(SqlTypeCode sqlType) { if (!IsIntervalType(sqlType)) throw new ArgumentException(String.Format("SQL Type {0} is not a valid INTERVAL.", sqlType.ToString().ToUpperInvariant())); }
private string DateErrorMessage(string str, SqlTypeCode sqlType, string[] formats) { return String.Format("The input string {0} of type {1} is not compatible with any of the formats for SQL Type {2} ( {3} )", str, TypeCode.ToString().ToUpperInvariant(), sqlType.ToString().ToUpperInvariant(), String.Join(", ", formats)); }
public static SqlType Resolve(SqlTypeCode typeCode, DataTypeMeta[] meta, ITypeResolver resolver) { return(Resolve(typeCode, typeCode.ToString().ToUpperInvariant(), meta, resolver)); }
/// <summary> /// Constructs the <see cref="SqlType"/> for the given specific /// <see cref="SqlTypeCode">SQL TYPE</see>. /// </summary> /// <remarks> /// This constructor will set the <see cref="Name"/> value to the equivalent /// of the SQL Type specified. /// </remarks> /// <param name="sqlType">The code of the SQL Type this object will represent.</param> protected SqlType(SqlTypeCode sqlType) : this(sqlType.ToString().ToUpperInvariant(), sqlType) { }