Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterMetadata{TDbType}" /> class.
 /// </summary>
 /// <param name="sqlParameterName">Name of the SQL parameter.</param>
 /// <param name="sqlVariableName">Name of the SQL variable.</param>
 /// <param name="typeName">Name of the type.</param>
 /// <param name="dbType">Type of the database.</param>
 public ParameterMetadata(string sqlParameterName, string sqlVariableName, string typeName, TDbType?dbType)
 {
     TypeName         = typeName;
     SqlParameterName = sqlParameterName;
     ClrName          = Utilities.ToClrName(sqlParameterName);
     SqlVariableName  = sqlVariableName;
     DbType           = dbType;
     base.DbType      = dbType;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterMetadata{TDbType}"/> class.
 /// </summary>
 /// <param name="sqlParameterName">Name of the SQL parameter.</param>
 /// <param name="sqlVariableName">Name of the SQL variable.</param>
 /// <param name="typeName">Name of the type.</param>
 /// <param name="dbType">Type of the database.</param>
 /// <param name="isNullable">if set to <c>true</c> [is nullable].</param>
 /// <param name="maxLength">The maximum length.</param>
 /// <param name="precision">The precision.</param>
 /// <param name="scale">The scale.</param>
 /// <param name="fullTypeName">Full name of the type.</param>
 public ParameterMetadata(string sqlParameterName, string sqlVariableName, string typeName, TDbType?dbType, bool?isNullable, int?maxLength, int?precision, int?scale, string fullTypeName)
 {
     SqlParameterName = sqlParameterName;
     SqlVariableName  = sqlVariableName;
     TypeName         = typeName;
     ClrName          = Utilities.ToClrName(sqlParameterName);
     DbType           = dbType;
     base.DbType      = dbType;
     IsNullable       = isNullable;
     MaxLength        = maxLength;
     Precision        = precision;
     Scale            = scale;
     FullTypeName     = fullTypeName;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScalarFunctionMetadata{TName, TDbType}"/> class.
        /// </summary>
        /// <param name="name">The name of the scalar function.</param>
        /// <param name="parameters">The parameters.</param>
        /// <param name="typeName">Name of the return type.</param>
        /// <param name="dbType">Return type.</param>
        /// <param name="isNullable">if set to <c>true</c> if the return type is nullable.</param>
        /// <param name="maxLength">The maximum length of the return value.</param>
        /// <param name="precision">The precision of the return value.</param>
        /// <param name="scale">The scale of the return value.</param>
        /// <param name="fullTypeName">Full name of the return type.</param>
        public ScalarFunctionMetadata(TName name, IList <ParameterMetadata <TDbType> > parameters, string typeName, TDbType?dbType, bool isNullable, int?maxLength, int?precision, int?scale, string fullTypeName)
        {
            Name            = name;
            base.Name       = name.ToString();
            Parameters      = new ParameterMetadataCollection <TDbType>(name.ToString(), parameters);
            base.Parameters = Parameters.GenericCollection;

            m_Builder = new SqlBuilder <TDbType>(Name.ToString(), Parameters);


            TypeName     = typeName;
            DbType       = dbType;
            base.DbType  = dbType;
            IsNullable   = isNullable;
            Precision    = precision;
            MaxLength    = maxLength;
            Scale        = scale;
            FullTypeName = fullTypeName;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColumnMetadata{TDbType}" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="isComputed">if set to <c>true</c> is a computed column.</param>
        /// <param name="isPrimaryKey">if set to <c>true</c> is a primary key.</param>
        /// <param name="isIdentity">if set to <c>true</c> [is identity].</param>
        /// <param name="typeName">Name of the type.</param>
        /// <param name="dbType">Type used by the database.</param>
        /// <param name="quotedSqlName">Name of the quoted SQL.</param>
        /// <param name="isNullable">Indicates if the column is nullable.</param>
        /// <param name="maxLength">The maximum length.</param>
        /// <param name="precision">The precision.</param>
        /// <param name="scale">The scale.</param>
        /// <param name="fullTypeName">Full name of the type.</param>
        public ColumnMetadata(string name, bool isComputed, bool isPrimaryKey, bool isIdentity, string typeName, TDbType?dbType, string quotedSqlName, bool?isNullable, int?maxLength, int?precision, int?scale, string fullTypeName)
        {
            TypeName      = typeName;
            SqlName       = name;
            IsComputed    = isComputed;
            IsPrimaryKey  = isPrimaryKey;
            IsIdentity    = isIdentity;
            DbType        = dbType;
            base.DbType   = dbType;
            QuotedSqlName = quotedSqlName;

            if (!string.IsNullOrWhiteSpace(name))
            {
                ClrName         = Utilities.ToClrName(name);
                SqlVariableName = "@" + ClrName;
            }

            IsNullable   = isNullable;
            Precision    = precision;
            MaxLength    = maxLength;
            Scale        = scale;
            FullTypeName = fullTypeName;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScalarFunctionMetadata{TName, TDbType}"/> class.
 /// </summary>
 /// <param name="name">The name of the scalar function.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="typeName">Name of the return type.</param>
 /// <param name="dbType">Return type.</param>
 /// <param name="isNullable">if set to <c>true</c> if the return type is nullable.</param>
 /// <param name="maxLength">The maximum length of the return value.</param>
 /// <param name="precision">The precision of the return value.</param>
 /// <param name="scale">The scale of the return value.</param>
 /// <param name="fullTypeName">Full name of the return type.</param>
 public ScalarFunctionMetadata(TName name, ParameterMetadataCollection <TDbType> parameters, string typeName, TDbType?dbType, bool isNullable, int?maxLength, int?precision, int?scale, string fullTypeName) : base(name.ToString() !, parameters?.GenericCollection !, typeName, dbType, isNullable, maxLength, precision, scale, fullTypeName)
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ColumnMetadata{TDbType}" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="isComputed">if set to <c>true</c> is a computed column.</param>
 /// <param name="isPrimaryKey">if set to <c>true</c> is a primary key.</param>
 /// <param name="isIdentity">if set to <c>true</c> [is identity].</param>
 /// <param name="typeName">Name of the type.</param>
 /// <param name="dbType">Type used by the database.</param>
 /// <param name="quotedSqlName">Name of the quoted SQL.</param>
 /// <param name="isNullable">Indicates if the column is nullable.</param>
 /// <param name="maxLength">The maximum length.</param>
 /// <param name="precision">The precision.</param>
 /// <param name="scale">The scale.</param>
 /// <param name="fullTypeName">Full name of the type.</param>
 /// <param name="clrType">The CLR type that matches this column's database type.</param>
 public ColumnMetadata(string name, bool isComputed, bool isPrimaryKey, bool isIdentity, string typeName, TDbType?dbType, string quotedSqlName, bool?isNullable, int?maxLength, int?precision, int?scale, string fullTypeName, Type?clrType) : base(name, isComputed, isPrimaryKey, isIdentity, typeName, dbType, quotedSqlName, isNullable, maxLength, precision, scale, fullTypeName, clrType)
 {
     DbType = dbType;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterMetadata{TDbType}"/> class.
 /// </summary>
 /// <param name="sqlParameterName">Name of the SQL parameter.</param>
 /// <param name="sqlVariableName">Name of the SQL variable.</param>
 /// <param name="typeName">Name of the type as known to the database.</param>
 /// <param name="dbType">Type of the database column as an enum.</param>
 /// <param name="isNullable">if set to <c>true</c> is nullable.</param>
 /// <param name="maxLength">The maximum length.</param>
 /// <param name="precision">The precision.</param>
 /// <param name="scale">The scale.</param>
 /// <param name="fullTypeName">Full name of the type.</param>
 /// <param name="direction">Indicates the direction of the parameter.</param>
 public ParameterMetadata(string sqlParameterName, string sqlVariableName, string typeName, TDbType?dbType, bool?isNullable, int?maxLength, int?precision, int?scale, string fullTypeName, ParameterDirection direction) : base(sqlParameterName, sqlVariableName, typeName, dbType, isNullable, maxLength, precision, scale, fullTypeName, direction)
 {
     DbType = dbType;
 }