Example #1
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.Append(SqlTypeInfo.ToString());
            if (Length != null || Scale != null)
            {
                sb.Append(" (")
                .Append(Length?.ToString("D", CultureInfo.InvariantCulture));
                if (Scale != null)
                {
                    sb.Append(Scale?.ToString("D", CultureInfo.InvariantCulture));
                }

                sb.Append(')');
            }

            if (!IsNullable)
            {
                sb.Append(" NOT");
            }

            sb.Append(" NULL");

            return(sb.ToString());
        }
Example #2
0
        public SqlType Clone(SqlTypeInfo sqlTypeInfo)
        {
            var sqlType = new SqlType
            {
                SqlTypeInfo = sqlTypeInfo,
                IsNullable  = IsNullable,
                Length      = Length,
                Scale       = Scale
            };

            return(sqlType);
        }