Class ForeignKeyDefinition
The foreign key definition
Inherited Members
Namespace: FluentMigrator.Model
Assembly: FluentMigrator.Abstractions.dll
Syntax
public class ForeignKeyDefinition : ICloneable, ICanBeValidated, IValidatableObject
Properties
| Edit this page View SourceForeignColumns
GEts or sets the foreign key column names
Declaration
public virtual ICollection<string> ForeignColumns { get; set; }
Property Value
Type | Description |
---|---|
ICollection<string> |
ForeignTable
Gets or sets the foreign key table
Declaration
[Required(ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "ForeignTableNameCannotBeNullOrEmpty")]
public virtual string ForeignTable { get; set; }
Property Value
Type | Description |
---|---|
string |
ForeignTableSchema
Gets or sets the foreign keys table schema
Declaration
public virtual string ForeignTableSchema { get; set; }
Property Value
Type | Description |
---|---|
string |
Name
Gets or sets a foreign key name
Declaration
[Required(ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "ForeignKeyNameCannotBeNullOrEmpty")]
public virtual string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
OnDelete
Gets or sets the rule for a cascading DELETE
Declaration
public virtual Rule OnDelete { get; set; }
Property Value
Type | Description |
---|---|
Rule |
OnUpdate
Gets or sets the rule for a cascading UPDATE
Declaration
public virtual Rule OnUpdate { get; set; }
Property Value
Type | Description |
---|---|
Rule |
PrimaryColumns
Gets or sets the primary key column names
Declaration
public virtual ICollection<string> PrimaryColumns { get; set; }
Property Value
Type | Description |
---|---|
ICollection<string> |
PrimaryTable
Gets or sets the primary table
Declaration
[Required(ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "PrimaryTableNameCannotBeNullOrEmpty")]
public virtual string PrimaryTable { get; set; }
Property Value
Type | Description |
---|---|
string |
PrimaryTableSchema
Gets or sets the primary table schema
Declaration
public virtual string PrimaryTableSchema { 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 virtual void CollectValidationErrors(ICollection<string> errors)
Parameters
Type | Name | Description |
---|---|---|
ICollection<string> | errors | The collection of error messages |
HasForeignAndPrimaryColumnsDefined()
Gets a value indicating whether primary and foreign key columns are defined
Declaration
public bool HasForeignAndPrimaryColumnsDefined()
Returns
Type | Description |
---|---|
bool |
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. |