示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlSizedDataType"/> class using the specified <paramref name="name"/>
 /// and <paramref name="size"/>.
 /// </summary>
 /// <param name="name">
 /// The name of the data type.
 /// </param>
 /// <param name="size">
 /// The size of the data type.
 /// </param>
 /// <exception cref="ArgumentOutOfRangeException">
 /// Thrown when the <paramref name="size"/> argument is less than 1 (unless <see langword="null"/> is specified).
 /// </exception>
 public SqlSizedDataType(SqlDataTypeName name, int?size = null)
     : base(name)
 {
     if (size != null && size < 1)
     {
         throw new ArgumentOutOfRangeException(nameof(size), size, "Size argument must be greater than or equal to 1.");
     }
     Size = size;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlPrecisionDataType"/> class using the specified <paramref name="name"/>
 /// and <paramref name="precision"/>.
 /// </summary>
 /// <param name="name">
 /// The name of the data type.
 /// </param>
 /// <param name="precision">
 /// The precision of the data type.
 /// </param>
 /// <exception cref="ArgumentOutOfRangeException">
 /// Thrown when the <paramref name="precision"/> argument is less than 1 (unless <see langword="null"/> is specified).
 /// </exception>
 public SqlPrecisionDataType(SqlDataTypeName name, int?precision = null)
     : base(name)
 {
     if (precision != null && precision < 1)
     {
         throw new ArgumentOutOfRangeException(nameof(precision), precision, "Precision argument must be greater than or equal to 1.");
     }
     Precision = precision;
 }