RelationalModelBuilderExtensions.UseCollation Method
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.
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. |
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
Entity Framework Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 5.0, 6.0, 7.0, 8.0, 9.0 |
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 Core 9.0 and other versions
Product | Versions |
---|---|
Entity Framework Core | 5.0, 6.0, 7.0, 8.0, 9.0 |
Entity Framework feedback
Entity Framework is an open source project. Select a link to provide feedback: