Class ConstraintDefinition
The constraint definition
Inherited Members
Namespace: FluentMigrator.Model
Assembly: FluentMigrator.Abstractions.dll
Syntax
public class ConstraintDefinition : ICloneable, ICanBeValidated, ISupportAdditionalFeatures, IValidatableObject
Constructors
| Edit this page View SourceConstraintDefinition(ConstraintType)
Initializes a new instance of the ConstraintDefinition class.
Declaration
public ConstraintDefinition(ConstraintType type)
Parameters
Type | Name | Description |
---|---|---|
ConstraintType | type |
Properties
| Edit this page View SourceAdditionalFeatures
Gets the dictionary to store the values for additional features
Declaration
public IDictionary<string, object> AdditionalFeatures { get; }
Property Value
Type | Description |
---|---|
IDictionary<string, object> |
Columns
Gets or sets the column names
Declaration
public virtual ICollection<string> Columns { get; set; }
Property Value
Type | Description |
---|---|
ICollection<string> |
ConstraintName
Gets or sets the constraint name
Declaration
public virtual string ConstraintName { get; set; }
Property Value
Type | Description |
---|---|
string |
IsPrimaryKeyConstraint
Gets a value indicating whether the constraint is a primary key constraint
Declaration
public bool IsPrimaryKeyConstraint { get; }
Property Value
Type | Description |
---|---|
bool |
IsUniqueConstraint
Gets a value indicating whether the constraint is a unique constraint
Declaration
public bool IsUniqueConstraint { get; }
Property Value
Type | Description |
---|---|
bool |
SchemaName
Gets or sets the schema name
Declaration
public virtual string SchemaName { get; set; }
Property Value
Type | Description |
---|---|
string |
TableName
Gets or sets the table name
Declaration
[Required(ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "TableNameCannotBeNullOrEmpty")]
public virtual string TableName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceClone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
object | A new object that is a copy of this instance. |
CollectValidationErrors(ICollection<string>)
Collect validation errors
Declaration
[Obsolete("Use the System.ComponentModel.DataAnnotations.Validator instead")]
public void CollectValidationErrors(ICollection<string> errors)
Parameters
Type | Name | Description |
---|---|---|
ICollection<string> | errors | The collection of error messages |
Validate(ValidationContext)
Determines whether the specified object is valid.
Declaration
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
Type | Name | Description |
---|---|---|
ValidationContext | validationContext | The validation context. |
Returns
Type | Description |
---|---|
IEnumerable<ValidationResult> | A collection that holds failed-validation information. |