Table of Contents

Class SqlColumnCollection

Namespace
LfrlAnvil.Sql.Objects
Assembly
LfrlAnvil.Sql.Core.dll

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 SqlColumnBuilderCollection

Source 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

SqlTable

Methods

Contains(string)

Checks whether or not a column with the provided name exists.

[Pure]
public bool Contains(string name)

Parameters

name string

Name 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 SqlColumnBuilder

Source column builder.

Returns

SqlColumn

New SqlColumn instance.

Get(string)

Returns a column with the provided name.

[Pure]
public SqlColumn Get(string name)

Parameters

name string

Name 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 string

Name of the column to return.

Returns

SqlColumn

Existing column or null when column does not exist.