Table of Contents

Class SqlViewDataFieldCollection

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

Represents a collection of SQL view data fields.

public abstract class SqlViewDataFieldCollection : ISqlViewDataFieldCollection, IReadOnlyCollection<ISqlViewDataField>, IEnumerable<ISqlViewDataField>, IEnumerable
Inheritance
SqlViewDataFieldCollection
Implements
Derived
Inherited Members

Constructors

SqlViewDataFieldCollection(SqlQueryExpressionNode)

Creates a new SqlViewDataFieldCollection instance.

protected SqlViewDataFieldCollection(SqlQueryExpressionNode source)

Parameters

source SqlQueryExpressionNode

Source query expression.

Properties

Count

Gets the number of elements in the collection.

public int Count { get; }

Property Value

int

The number of elements in the collection.

View

View that this collection belongs to.

public SqlView View { get; }

Property Value

SqlView

Methods

Contains(string)

Checks whether or not a data field with the provided name exists.

[Pure]
public bool Contains(string name)

Parameters

name string

Name to check.

Returns

bool

true when data field exists, otherwise false.

CreateDataField(string)

Creates a new SqlViewDataField instance.

[Pure]
protected abstract SqlViewDataField CreateDataField(string name)

Parameters

name string

Data field's name.

Returns

SqlViewDataField

New SqlViewDataField instance.

Get(string)

Returns a data field with the provided name.

[Pure]
public SqlViewDataField Get(string name)

Parameters

name string

Name of the data field to return.

Returns

SqlViewDataField

Existing data field.

Exceptions

KeyNotFoundException

When data field does not exist.

GetEnumerator()

Creates a new SqlObjectEnumerator<T> instance for this collection.

[Pure]
public SqlObjectEnumerator<SqlViewDataField> GetEnumerator()

Returns

SqlObjectEnumerator<SqlViewDataField>

New SqlObjectEnumerator<T> instance.

TryGet(string)

Attempts to return a data field with the provided name.

[Pure]
public SqlViewDataField? TryGet(string name)

Parameters

name string

Name of the data field to return.

Returns

SqlViewDataField

Existing data field or null when data field does not exist.