Beispiel #1
0
    /// <summary>
    /// Initializes a new instance of the <see cref="UserDefinedTableTypeMetadata{TObjectName, TDbType}" /> class.
    /// </summary>
    /// <param name="name">The name.</param>
    /// <param name="columns">The columns.</param>
    /// <exception cref="ArgumentException">name</exception>
    /// <exception cref="ArgumentNullException">columns</exception>
    protected UserDefinedTableTypeMetadata(string name, ColumnMetadataCollection columns)
    {
        if (string.IsNullOrEmpty(name))
        {
            throw new ArgumentException($"{nameof(name)} is null or empty.", nameof(name));
        }

        Name    = name;
        Columns = columns ?? throw new ArgumentNullException(nameof(columns), $"{nameof(columns)} is null.");
    }
Beispiel #2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="ForeignKeyConstraint" /> class.
    /// </summary>
    /// <param name="parentTableName">Name of the parent table.</param>
    /// <param name="parentColumns">The parent columns.</param>
    /// <param name="childTableName">Name of the child table.</param>
    /// <param name="childColumns">The child columns.</param>
    /// <exception cref="ArgumentException">
    /// parentColumns
    /// or
    /// childColumns
    /// </exception>
    protected ForeignKeyConstraint(string parentTableName, ColumnMetadataCollection parentColumns, string childTableName, ColumnMetadataCollection childColumns)
    {
        if (parentColumns == null || parentColumns.Count == 0)
        {
            throw new ArgumentException($"{nameof(parentColumns)} is null or empty.", nameof(parentColumns));
        }

        if (childColumns == null || childColumns.Count == 0)
        {
            throw new ArgumentException($"{nameof(childColumns)} is null or empty.", nameof(childColumns));
        }

        ParentTableName = parentTableName;
        ParentColumns   = parentColumns;
        ChildTableName  = childTableName;
        ChildColumns    = childColumns;
    }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserDefinedTableTypeMetadata{TObjectName, TDbType}" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="columns">The columns.</param>
 public UserDefinedTableTypeMetadata(TObjectName name, ColumnMetadataCollection <TDbType> columns)
     : base(name.ToString() !, columns?.GenericCollection !)
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MySqlTableOrViewMetadata" /> class.
 /// </summary>
 /// <param name="metadataCache">The metadata cache.</param>
 /// <param name="name">The name.</param>
 /// <param name="isTable">if set to <c>true</c> is a table.</param>
 /// <param name="columns">The columns.</param>
 /// <param name="engine">The engine.</param>
 internal MySqlTableOrViewMetadata(DatabaseMetadataCache <MySqlObjectName, MySqlDbType> metadataCache, MySqlObjectName name, bool isTable, ColumnMetadataCollection <MySqlDbType> columns, string?engine) : base(metadataCache, name, isTable, columns)
 {
     Engine = engine;
 }
Beispiel #5
0
 /// <summary>Initializes a new instance of the <see cref="Tortuga.Chain.Metadata.TableFunctionMetadata{TObjectName, TDbType}"/> class.</summary>
 /// <param name="name">The name.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="columns">The columns.</param>
 public TableFunctionMetadata(TObjectName name, ParameterMetadataCollection <TDbType> parameters, ColumnMetadataCollection <TDbType> columns) : base(name.ToString() !, parameters?.GenericCollection !, columns?.GenericCollection !)
 /// <summary>
 /// Initializes a new instance of the <see cref="ColumnMetadataCollection{TDbType}" /> class.
 /// </summary>
 /// <param name="name">The name of the parent object.</param>
 /// <param name="list">The list to wrap.</param>
 public ColumnMetadataCollection(string name, IList <ColumnMetadata <TDbType> > list) : base(list)
 {
     m_Name            = name;
     GenericCollection = new ColumnMetadataCollection(name, this);
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlServerTableOrViewMetadata{TDbType}" /> class.
 /// </summary>
 /// <param name="metadataCache">The metadata cache.</param>
 /// <param name="name">The name.</param>
 /// <param name="isTable">if set to <c>true</c> is a table.</param>
 /// <param name="columns">The columns.</param>
 /// <param name="hasTriggers">if set to <c>true</c> has triggers.</param>
 public SqlServerTableOrViewMetadata(DatabaseMetadataCache <SqlServerObjectName, TDbType> metadataCache, SqlServerObjectName name, bool isTable, ColumnMetadataCollection <TDbType> columns, bool hasTriggers) : base(metadataCache, name, isTable, columns)
 {
     HasTriggers = hasTriggers;
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ForeignKeyConstraint{TObjectName, TDbType}" /> class.
 /// </summary>
 /// <param name="parentTableName">Name of the parent table.</param>
 /// <param name="parentColumns">The parent columns.</param>
 /// <param name="childTableName">Name of the child table.</param>
 /// <param name="childColumns">The child columns.</param>
 public ForeignKeyConstraint(TObjectName parentTableName, ColumnMetadataCollection <TDbType> parentColumns, TObjectName childTableName, ColumnMetadataCollection <TDbType> childColumns) : base(parentTableName.ToString() !, parentColumns?.GenericCollection !, childTableName.ToString() !, childColumns?.GenericCollection !)
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TableFunctionMetadata"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="columns">The columns.</param>
 /// <exception cref="ArgumentException">name</exception>
 /// <exception cref="ArgumentNullException">
 /// parameters
 /// or
 /// columns
 /// </exception>
 protected TableFunctionMetadata(string name, ParameterMetadataCollection parameters, ColumnMetadataCollection columns) : base(name)
 {
     Parameters      = parameters ?? throw new ArgumentNullException(nameof(parameters), $"{nameof(parameters)} is null.");
     Columns         = columns ?? throw new ArgumentNullException(nameof(columns), $"{nameof(columns)} is null.");
     NullableColumns = new ColumnMetadataCollection(name, columns.Where(c => c.IsNullable == true).ToList());
 }
Beispiel #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TableOrViewMetadata{TObjectName, TDbType}"/> class.
 /// </summary>
 /// <param name="metadataCache">The metadata cache.</param>
 /// <param name="name">The name.</param>
 /// <param name="isTable">if set to <c>true</c> [is table].</param>
 /// <param name="columns">The columns.</param>
 public TableOrViewMetadata(DatabaseMetadataCache <TObjectName, TDbType> metadataCache, TObjectName name, bool isTable, ColumnMetadataCollection <TDbType> columns) : base(name.ToString() !, isTable, columns?.GenericCollection !)