Search Results for

    Show / Hide Table of Contents

    Class MySQLModelBuilderExtensions

    MySQL-specific extension methods for Microsoft.EntityFrameworkCore.ModelBuilder.

    Inheritance
    System.Object
    MySQLModelBuilderExtensions
    Namespace: MySql.EntityFrameworkCore.Extensions
    Assembly: MySql.EntityFrameworkCore.dll
    Version: 9.3.0
    Syntax
    public static class MySQLModelBuilderExtensions

    Methods

    CanSetCharSet(IConventionModelBuilder, String, Boolean)

    Returns a value indicating whether the given character set can be set as default.

    Declaration
    public static bool CanSetCharSet(this IConventionModelBuilder modelBuilder, string charSet, bool fromDataAnnotation = false)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder

    The model builder.

    System.String charSet

    The character set.

    System.Boolean fromDataAnnotation

    Indicates whether the configuration was specified using a data annotation.

    Returns
    Type Description
    System.Boolean

    true if the given character set can be set as default.

    HasCharSet(IConventionModelBuilder, String, Boolean)

    Sets the default character set to use for the model or database.

    Declaration
    public static IConventionModelBuilder HasCharSet(this IConventionModelBuilder modelBuilder, string charSet, bool fromDataAnnotation = false)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder

    The model builder.

    System.String charSet

    The name of the character set to use.

    System.Boolean fromDataAnnotation

    Indicates whether the configuration was specified using a data annotation.

    Returns
    Type Description
    Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder

    The same builder instance if the configuration was applied, null otherwise.

    HasCharSet(ModelBuilder, String)

    Sets the default character set to use for the model or database.

    Declaration
    public static ModelBuilder HasCharSet(this ModelBuilder modelBuilder, string charSet)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder

    The model builder.

    System.String charSet

    The name of the character set to use.

    Returns
    Type Description
    Microsoft.EntityFrameworkCore.ModelBuilder

    The same builder instance so that multiple calls can be chained.

    UseCollation(IConventionModelBuilder, String, Boolean)

    Configures the database collation, which will be used by all columns without an explicit collation. Also finely controls where to apply the collation recursively (including this model or database).

    Declaration
    public static IConventionModelBuilder UseCollation(this IConventionModelBuilder modelBuilder, string collation, bool fromDataAnnotation = false)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder

    The model builder.

    System.String collation

    The collation.

    System.Boolean fromDataAnnotation

    Indicates whether the configuration was specified using a data annotation.

    Returns
    Type Description
    Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder

    The same builder instance if the configuration was applied, null otherwise.

    UseCollation(ModelBuilder, String)

    Configures the database collation, which will be used by all columns without an explicit collation. Also finely controls where to apply the collation recursively (including this model or database).

    Declaration
    public static ModelBuilder UseCollation(this ModelBuilder modelBuilder, string collation)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder

    The model builder.

    System.String collation

    The collation.

    Returns
    Type Description
    Microsoft.EntityFrameworkCore.ModelBuilder

    The same builder instance so that multiple calls can be chained.

    In This Article
    • Methods
      • CanSetCharSet(IConventionModelBuilder, String, Boolean)
      • HasCharSet(IConventionModelBuilder, String, Boolean)
      • HasCharSet(ModelBuilder, String)
      • UseCollation(IConventionModelBuilder, String, Boolean)
      • UseCollation(ModelBuilder, String)
    Back to top Copyright © 2021, 2025, Oracle and/or its affiliates.