예제 #1
0
 /// <summary>Initializes a new instance of the <see cref="Tortuga.Chain.Metadata.TableOrViewMetadata"/> class.</summary>
 protected TableOrViewMetadata(string name, bool isTable, ColumnMetadataCollection columns) : base(name)
 {
     IsTable            = isTable;
     Columns            = columns ?? throw new ArgumentNullException(nameof(columns), $"{nameof(columns)} is null.");
     NonNullableColumns = new ColumnMetadataCollection(name, columns.Where(c => c.IsNullable == false).ToList());
     PrimaryKeyColumns  = new ColumnMetadataCollection(name, columns.Where(c => c.IsPrimaryKey).ToList());
 }
예제 #2
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());
 }