Search Results for

    Show / Hide Table of Contents

    Class ColumnDefinition

    The column definition

    Inheritance
    object
    ColumnDefinition
    Implements
    ICloneable
    ICanBeValidated
    ISupportAdditionalFeatures
    IValidatableObject
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: FluentMigrator.Model
    Assembly: FluentMigrator.Abstractions.dll
    Syntax
    public class ColumnDefinition : ICloneable, ICanBeValidated, ISupportAdditionalFeatures, IValidatableObject

    Properties

    | Edit this page View Source

    AdditionalFeatures

    Gets the dictionary to store the values for additional features

    Declaration
    public IDictionary<string, object> AdditionalFeatures { get; }
    Property Value
    Type Description
    IDictionary<string, object>
    | Edit this page View Source

    CollationName

    Gets or sets the collation name if the column has a string or ansi string type

    Declaration
    public virtual string CollationName { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    ColumnDescription

    Gets or sets the column description

    Declaration
    public virtual string ColumnDescription { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    CustomType

    Gets or sets a database specific custom column type

    Declaration
    public virtual string CustomType { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    DefaultValue

    Gets or sets the columns default value

    Declaration
    public virtual object DefaultValue { get; set; }
    Property Value
    Type Description
    object
    | Edit this page View Source

    ForeignKey

    Gets or sets the foreign key definition

    Declaration
    public virtual ForeignKeyDefinition ForeignKey { get; set; }
    Property Value
    Type Description
    ForeignKeyDefinition
    Remarks

    A column might be marked as IsForeignKey, but ForeignKey might still be null. This happens when ForeignKey() without arguments gets called on a column.

    | Edit this page View Source

    IsForeignKey

    Gets or sets a value indicating whether this column is a foreign key

    Declaration
    public virtual bool IsForeignKey { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsIdentity

    Gets or sets a value indicating whether this column gets its value using an identity definition

    Declaration
    public virtual bool IsIdentity { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsIndexed

    Gets or sets a value indicating that this column is indexed

    Declaration
    public virtual bool IsIndexed { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsNullable

    Gets or sets a value indicating whether this column is nullable

    Declaration
    public virtual bool? IsNullable { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    IsPrimaryKey

    Gets or sets a value indicating whether this column is a primary key

    Declaration
    public virtual bool IsPrimaryKey { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    IsUnique

    Gets or sets a value indicating whether this column must be unique

    Declaration
    public virtual bool IsUnique { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    ModificationType

    Gets or sets if the column definition results in a CREATE or an ALTER SQL statement

    Declaration
    public virtual ColumnModificationType ModificationType { get; set; }
    Property Value
    Type Description
    ColumnModificationType
    | Edit this page View Source

    Name

    Gets or sets the column definition name

    Declaration
    [Required(ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "ColumnNameCannotBeNullOrEmpty")]
    public virtual string Name { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Precision

    Gets or sets the column type precision (read: scale)

    Declaration
    public virtual int? Precision { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    PrimaryKeyName

    Gets or sets the primary key constraint name

    Declaration
    public virtual string PrimaryKeyName { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Size

    Gets or sets the column type size (read: precision or length)

    Declaration
    public virtual int? Size { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    TableName

    Gets or sets the columns table name

    Declaration
    public virtual string TableName { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Type

    Gets or sets the column type

    Declaration
    public virtual DbType? Type { get; set; }
    Property Value
    Type Description
    DbType?

    Methods

    | Edit this page View Source

    Clone()

    Creates a new object that is a copy of the current instance.

    Declaration
    public virtual object Clone()
    Returns
    Type Description
    object

    A new object that is a copy of this instance.

    | Edit this page View Source

    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

    | Edit this page View Source

    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.

    Implements

    ICloneable
    ICanBeValidated
    ISupportAdditionalFeatures
    IValidatableObject

    Extension Methods

    LegacyValidationExtensions.CollectErrors(ICanBeValidated, ICollection<string>, IServiceProvider)
    LegacyValidationExtensions.TryCollectResults(ICanBeValidated, ICollection<ValidationResult>, IServiceProvider, IDictionary<object, object>)
    AdditionalFeaturesExtensions.GetAdditionalFeature<T>(ISupportAdditionalFeatures, string, Func<T>)
    AdditionalFeaturesExtensions.GetAdditionalFeature<T>(ISupportAdditionalFeatures, string, T)
    AdditionalFeaturesExtensions.SetAdditionalFeature<T>(ISupportAdditionalFeatures, string, T)
    PostgresExtensions.Using(ISupportAdditionalFeatures, Algorithm)
    • Edit this page
    • View Source
    In this article
    Back to top
    Copyright © 2018 Fluent Migrator Project
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.