/// <summary> /// Initializes a new instance of the <see cref="UserDefinedTableTypeMetadata{TName, 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."); }
/// <summary> /// </summary> /// <param name="name">The name.</param> /// <param name="parameters">The parameters.</param> /// <param name="columns">The columns.</param> public TableFunctionMetadata(TName name, IList <ParameterMetadata <TDbType> > parameters, IList <ColumnMetadata <TDbType> > columns) { Name = name; base.Name = name.ToString(); Columns = new ColumnMetadataCollection <TDbType>(name.ToString(), columns); base.Columns = Columns.GenericCollection; Parameters = new ParameterMetadataCollection <TDbType>(name.ToString(), parameters); base.Parameters = Parameters.GenericCollection; m_Builder = new SqlBuilder <TDbType>(Name.ToString(), Columns, Parameters); }
/// <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; }
/// <summary> /// Initializes a new instance of the <see cref="ForeignKeyConstraint{TName, 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(TName parentTableName, ColumnMetadataCollection <TDbType> parentColumns, TName childTableName, ColumnMetadataCollection <TDbType> childColumns) : base(parentTableName.ToString() !, parentColumns?.GenericCollection !, childTableName.ToString() !, childColumns?.GenericCollection !)
/// <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()); }
/// <summary>Initializes a new instance of the <see cref="Tortuga.Chain.Metadata.TableFunctionMetadata{TName, TDbType}"/> class.</summary> /// <param name="name">The name.</param> /// <param name="parameters">The parameters.</param> /// <param name="columns">The columns.</param> public TableFunctionMetadata(TName 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(list); }
/// <summary> /// Initializes a new instance of the <see cref="TableOrViewMetadata{TName, 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 <TName, TDbType> metadataCache, TName name, bool isTable, ColumnMetadataCollection <TDbType> columns) : base(name.ToString() !, isTable, columns?.GenericCollection !)
/// <summary> /// Initializes a new instance of the <see cref="UserDefinedTableTypeMetadata{TName, TDbType}" /> class. /// </summary> /// <param name="name">The name.</param> /// <param name="columns">The columns.</param> public UserDefinedTableTypeMetadata(TName name, ColumnMetadataCollection <TDbType> columns) : base(name.ToString() !, columns?.GenericCollection !)