RelationalModelBuilderExtensions.UseCollation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
UseCollation(ModelBuilder, String) |
Configures the database collation, which will be used by all columns without an explicit collation. |
UseCollation(IConventionModelBuilder, String, Boolean) |
Configures the database collation, which will be used by all columns without an explicit collation. |
UseCollation(ModelBuilder, String)
Configures the database collation, which will be used by all columns without an explicit collation.
public static Microsoft.EntityFrameworkCore.ModelBuilder UseCollation (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string collation);
public static Microsoft.EntityFrameworkCore.ModelBuilder UseCollation (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string? collation);
static member UseCollation : Microsoft.EntityFrameworkCore.ModelBuilder * string -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function UseCollation (modelBuilder As ModelBuilder, collation As String) As ModelBuilder
Parameters
- modelBuilder
- ModelBuilder
The model builder.
- collation
- String
The collation.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Database collations for more information and examples.
Applies to
UseCollation(IConventionModelBuilder, String, Boolean)
Configures the database collation, which will be used by all columns without an explicit collation.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder UseCollation (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string collation, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder? UseCollation (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string? collation, bool fromDataAnnotation = false);
static member UseCollation : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder
<Extension()>
Public Function UseCollation (modelBuilder As IConventionModelBuilder, collation As String, Optional fromDataAnnotation As Boolean = false) As IConventionModelBuilder
Parameters
- modelBuilder
- IConventionModelBuilder
The model builder.
- collation
- String
The collation.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the configuration was applied,
null
otherwise.
Remarks
See Database collations for more information and examples.
Applies to
Entity Framework