Class MySQLModelBuilderExtensions
MySQL-specific extension methods for Microsoft.
Inheritance
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. |
modelBuilder | The model builder. |
System. |
charSet | The character set. |
System. |
fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
System. |
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. |
modelBuilder | The model builder. |
System. |
charSet | The name of the character set to use. |
System. |
fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
Microsoft. |
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. |
modelBuilder | The model builder. |
System. |
charSet | The name of the character set to use. |
Returns
Type | Description |
---|---|
Microsoft. |
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. |
modelBuilder | The model builder. |
System. |
collation | The collation. |
System. |
fromDataAnnotation | Indicates whether the configuration was specified using a data annotation. |
Returns
Type | Description |
---|---|
Microsoft. |
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. |
modelBuilder | The model builder. |
System. |
collation | The collation. |
Returns
Type | Description |
---|---|
Microsoft. |
The same builder instance so that multiple calls can be chained. |