Table of Contents

Class SqlConstraintBuilder

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

Represents an SQL constraint builder attached to a table.

public abstract class SqlConstraintBuilder : SqlObjectBuilder, ISqlConstraintBuilder, ISqlObjectBuilder
Inheritance
SqlConstraintBuilder
Implements
Derived
Inherited Members

Constructors

SqlConstraintBuilder(SqlTableBuilder, string)

Creates a new SqlConstraintBuilder instance.

protected SqlConstraintBuilder(SqlTableBuilder table, string name)

Parameters

table SqlTableBuilder

Table that this constraint is attached to.

name string

Object's name.

Properties

Table

Table that this constraint is attached to.

public SqlTableBuilder Table { get; }

Property Value

SqlTableBuilder

Methods

AfterNameChange(string)

Callback invoked just after Name change has been processed.

protected override void AfterNameChange(string originalValue)

Parameters

originalValue string

Original value.

AfterRemove()

Callback invoked just after the removal has been processed.

protected override void AfterRemove()

BeforeNameChange(string)

Callback invoked just before Name change is processed.

protected override SqlPropertyChange<string> BeforeNameChange(string newValue)

Parameters

newValue string

Value to set.

Returns

SqlPropertyChange<string>

SqlPropertyChange<T> instance associated with Name change attempt.

Exceptions

SqlObjectBuilderException

When Name of this object cannot be changed.

BeforeRemove()

Callback invoked just before the removal is processed.

protected override void BeforeRemove()

Exceptions

SqlObjectBuilderException

When this object cannot be removed.

GetDefaultName()

Creates a default name for this constraint.

[Pure]
protected abstract string GetDefaultName()

Returns

string

Default name for this constraint.

SetDefaultName()

Changes the name of this object to a default name.

public SqlConstraintBuilder SetDefaultName()

Returns

SqlConstraintBuilder

this.

Remarks

See ISqlDefaultObjectNameProvider for more information.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

SetName(string)

Changes the name of this object.

public SqlConstraintBuilder SetName(string name)

Parameters

name string

Name to set.

Returns

SqlConstraintBuilder

this.

Exceptions

SqlObjectBuilderException

When name cannot be changed.

ToString()

Returns a string representation of this SqlConstraintBuilder instance.

[Pure]
public override string ToString()

Returns

string

String representation.