Class SqlConstraintBuilder
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
SqlTableBuilderTable that this constraint is attached to.
name
stringObject's name.
Properties
Table
Table that this constraint is attached to.
public SqlTableBuilder Table { get; }
Property Value
Methods
AfterNameChange(string)
Callback invoked just after Name change has been processed.
protected override void AfterNameChange(string originalValue)
Parameters
originalValue
stringOriginal 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
stringValue 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
stringName 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.