Class SqlColumnCollection
Represents a collection of SQL table columns.
public abstract class SqlColumnCollection : ISqlColumnCollection, IReadOnlyCollection<ISqlColumn>, IEnumerable<ISqlColumn>, IEnumerable
- Inheritance
-
SqlColumnCollection
- Implements
- Derived
- Inherited Members
Constructors
SqlColumnCollection(SqlColumnBuilderCollection)
Creates a new SqlColumnCollection instance.
protected SqlColumnCollection(SqlColumnBuilderCollection source)
Parameters
source
SqlColumnBuilderCollectionSource builder collection.
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
Table
Table that this collection belongs to.
public SqlTable Table { get; }
Property Value
Methods
Contains(string)
Checks whether or not a column with the provided name
exists.
[Pure]
public bool Contains(string name)
Parameters
name
stringName to check.
Returns
- bool
true when column exists, otherwise false.
CreateColumn(SqlColumnBuilder)
Creates a new SqlColumn instance.
[Pure]
protected abstract SqlColumn CreateColumn(SqlColumnBuilder builder)
Parameters
builder
SqlColumnBuilderSource column builder.
Returns
Get(string)
Returns a column with the provided name
.
[Pure]
public SqlColumn Get(string name)
Parameters
name
stringName of the column to return.
Returns
- SqlColumn
Existing column.
Exceptions
- KeyNotFoundException
When column does not exist.
GetEnumerator()
Creates a new SqlObjectEnumerator<T> instance for this collection.
[Pure]
public SqlObjectEnumerator<SqlColumn> GetEnumerator()
Returns
- SqlObjectEnumerator<SqlColumn>
New SqlObjectEnumerator<T> instance.
TryGet(string)
Attempts to return a column with the provided name
.
[Pure]
public SqlColumn? TryGet(string name)
Parameters
name
stringName of the column to return.
Returns
- SqlColumn
Existing column or null when column does not exist.