Search Results for

    Show / Hide Table of Contents
    View Source

    Class ExpressionBuilderBase<TExpression, TNext>

    Provides a base class for expression builders.

    Inheritance
    object
    ExpressionBuilderBase<TExpression>
    Namespace: Umbraco.Cms.Infrastructure.Migrations.Expressions
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class ExpressionBuilderBase<TExpression, TNext> : ExpressionBuilderBase<TExpression> where TExpression : IMigrationExpression where TNext : IFluentBuilder
    Type Parameters
    Name Description
    TExpression
    TNext

    Constructors

    View Source

    ExpressionBuilderBase(TExpression)

    Initializes a new instance of the ExpressionBuilderBase<TExpression, TNext> class.

    Declaration
    protected ExpressionBuilderBase(TExpression expression)
    Parameters
    Type Name Description
    TExpression expression

    Methods

    View Source

    AsAnsiString()

    Sets the type of the column being configured to System.Data.DbType.AnsiString, indicating a variable-length ANSI (non-Unicode) string.

    Declaration
    public TNext AsAnsiString()
    Returns
    Type Description
    TNext

    The next expression in the builder chain, allowing for fluent configuration.

    View Source

    AsAnsiString(int)

    Sets the type of the column being configured to System.Data.DbType.AnsiString, indicating a variable-length ANSI (non-Unicode) string.

    Declaration
    public TNext AsAnsiString(int size)
    Parameters
    Type Name Description
    int size
    Returns
    Type Description
    TNext

    The next expression in the builder chain, allowing for fluent configuration.

    View Source

    AsBinary()

    Specifies that the column type should be set to binary in the migration expression.

    Declaration
    public TNext AsBinary()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsBinary(int)

    Specifies that the column type should be set to binary with the specified size in the migration expression.

    Declaration
    public TNext AsBinary(int size)
    Parameters
    Type Name Description
    int size

    The maximum size, in bytes, of the binary column.

    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsBoolean()

    Sets the current column's data type to System.Data.DbType.Boolean.

    Declaration
    public TNext AsBoolean()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsByte()

    Sets the database column type to System.Data.DbType.Byte for the current column in the migration expression.

    Declaration
    public TNext AsByte()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent migration chain.

    View Source

    AsCurrency()

    Sets the database column type to System.Data.DbType.Currency, indicating that the column will store currency values.

    Declaration
    public TNext AsCurrency()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsCustom(string)

    Sets the column to use a custom database type.

    Declaration
    public TNext AsCustom(string customType)
    Parameters
    Type Name Description
    string customType

    The custom database type to use for the column.

    Returns
    Type Description
    TNext

    The next expression builder in the migration expression chain.

    View Source

    AsDate()

    Sets the type of the current column to System.Data.DbType.Date, indicating that the column will store date values (without time).

    Declaration
    public TNext AsDate()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent migration chain, allowing further configuration.

    View Source

    AsDateTime()

    Specifies that the column type should be set to System.Data.DbType.DateTime.

    Declaration
    public TNext AsDateTime()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsDecimal()

    Specifies that the column type should be set to decimal in the database schema.

    Declaration
    public TNext AsDecimal()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsDecimal(int, int)

    Specifies that the column type should be set to decimal in the database schema with the specified precision and scale.

    Declaration
    public TNext AsDecimal(int size, int precision)
    Parameters
    Type Name Description
    int size

    The precision, i.e., the maximum total number of digits that the decimal column can store.

    int precision

    The scale, i.e., the number of digits that can be stored to the right of the decimal point.

    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsDouble()

    Sets the type of the column to System.Data.DbType.Double in the migration expression.

    Declaration
    public TNext AsDouble()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent migration chain.

    View Source

    AsFixedLengthAnsiString(int)

    Sets the column type to a fixed length ANSI string with the specified size.

    Declaration
    public TNext AsFixedLengthAnsiString(int size)
    Parameters
    Type Name Description
    int size

    The fixed length size of the ANSI string.

    Returns
    Type Description
    TNext

    The next expression builder in the chain.

    View Source

    AsFixedLengthString(int)

    Configures the column to use a fixed-length string data type with the specified size.

    Declaration
    public TNext AsFixedLengthString(int size)
    Parameters
    Type Name Description
    int size

    The length of the fixed-length string column.

    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsFloat()

    Sets the column type of the current expression to a floating-point number (corresponding to System.Data.DbType.Single) and returns the next expression builder in the chain.

    Declaration
    public TNext AsFloat()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent API chain.

    View Source

    AsGuid()

    Sets the current column's database type to System.Data.DbType.Guid.

    Declaration
    public TNext AsGuid()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsInt16()

    Specifies that the column type should be System.Data.DbType.Int16 (16-bit integer).

    Declaration
    public TNext AsInt16()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsInt32()

    Specifies that the column type should be System.Data.DbType.Int32 (32-bit integer).

    Declaration
    public TNext AsInt32()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent chain.

    View Source

    AsInt64()

    Sets the type of the current column to System.Data.DbType.Int64, representing a 64-bit integer in the database schema.

    Declaration
    public TNext AsInt64()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent migration chain.

    View Source

    AsString()

    Sets the type of the current column to System.Data.DbType.String in the migration expression.

    Declaration
    public TNext AsString()
    Returns
    Type Description
    TNext

    The next expression builder in the fluent migration chain.

    View Source

    AsString(int)

    Sets the type of the current column to System.Data.DbType.String with the specified size in the migration expression.

    Declaration
    public TNext AsString(int size)
    Parameters
    Type Name Description
    int size

    The maximum length of the string column.

    Returns
    Type Description
    TNext

    The next expression builder in the fluent migration chain.

    View Source

    AsTime()

    Sets the column type to System.Data.DbType.Time.

    Declaration
    public TNext AsTime()
    Returns
    Type Description
    TNext

    The next expression builder in the chain.

    View Source

    AsXml()

    Sets the column type to XML.

    Declaration
    public TNext AsXml()
    Returns
    Type Description
    TNext

    The next expression builder in the chain.

    View Source

    AsXml(int)

    Declaration
    public TNext AsXml(int size)
    Parameters
    Type Name Description
    int size
    Returns
    Type Description
    TNext
    View Source

    GetColumnForType()

    Retrieves the Umbraco.Cms.Infrastructure.Migrations.Expressions.ColumnDefinition associated with the current expression's type, if one exists.

    Declaration
    public abstract ColumnDefinition? GetColumnForType()
    Returns
    Type Description
    ColumnDefinition

    The corresponding Umbraco.Cms.Infrastructure.Migrations.Expressions.ColumnDefinition if available; otherwise, null.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX