Search Results for

    Show / Hide Table of Contents
    View Source

    Class CreateConstraintBuilder

    Provides a fluent builder for defining database constraints as part of migration expressions. Use this builder to specify constraint details when creating constraints in database migrations.

    Inheritance
    object
    ExpressionBuilderBase<CreateConstraintExpression>
    Namespace: Umbraco.Cms.Infrastructure.Migrations.Expressions.Create.Constraint
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class CreateConstraintBuilder : ExpressionBuilderBase<CreateConstraintExpression>, ICreateConstraintOnTableBuilder, ICreateConstraintColumnsBuilder, IFluentBuilder

    Constructors

    View Source

    CreateConstraintBuilder(CreateConstraintExpression)

    Initializes a new instance of the CreateConstraintBuilder class using the specified constraint expression.

    Declaration
    public CreateConstraintBuilder(CreateConstraintExpression expression)
    Parameters
    Type Name Description
    CreateConstraintExpression expression

    The CreateConstraintExpression that defines the constraint to be created.

    Methods

    View Source

    Column(string)

    Specifies the name of the column to which the constraint will be applied in the migration.

    Declaration
    public IExecutableBuilder Column(string columnName)
    Parameters
    Type Name Description
    string columnName

    The name of the column to specify for the constraint.

    Returns
    Type Description
    IExecutableBuilder

    An IExecutableBuilder to execute the next step in the migration.

    View Source

    Columns(string[])

    Specifies the constraint columns.

    Declaration
    public IExecutableBuilder Columns(string[] columnNames)
    Parameters
    Type Name Description
    string[] columnNames
    Returns
    Type Description
    IExecutableBuilder
    View Source

    OnTable(string)

    Specifies the table name.

    Declaration
    public ICreateConstraintColumnsBuilder OnTable(string tableName)
    Parameters
    Type Name Description
    string tableName
    Returns
    Type Description
    ICreateConstraintColumnsBuilder
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX