Class SqlPrimaryKeyBuilder
Represents an SQL primary key constraint builder.
public abstract class SqlPrimaryKeyBuilder : SqlConstraintBuilder, ISqlPrimaryKeyBuilder, ISqlConstraintBuilder, ISqlObjectBuilder
- Inheritance
-
SqlPrimaryKeyBuilder
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
SqlPrimaryKeyBuilder(SqlIndexBuilder, string)
Creates a new SqlPrimaryKeyBuilder instance.
protected SqlPrimaryKeyBuilder(SqlIndexBuilder index, string name)
Parameters
index
SqlIndexBuilderUnderlying index that defines this primary key.
name
stringObject's name.
Properties
CanRemove
Specifies whether or not this object can be removed.
public override bool CanRemove { get; }
Property Value
Index
Underlying index that defines this primary key.
public SqlIndexBuilder Index { get; }
Property Value
Methods
AfterRemove()
Callback invoked just after the removal has been processed.
protected override void AfterRemove()
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 override sealed string GetDefaultName()
Returns
- string
Default name for this constraint.
SetDefaultName()
Changes the name of this object to a default name.
public SqlPrimaryKeyBuilder SetDefaultName()
Returns
- SqlPrimaryKeyBuilder
this.
Remarks
See ISqlDefaultObjectNameProvider for more information.
Exceptions
- SqlObjectBuilderException
When name cannot be changed.
SetName(string)
Changes the name of this object.
public SqlPrimaryKeyBuilder SetName(string name)
Parameters
name
stringName to set.
Returns
- SqlPrimaryKeyBuilder
this.
Exceptions
- SqlObjectBuilderException
When name cannot be changed.