Class MySQLDbContextOptionsExtensions
MySQL specific extension methods for Microsoft.
Inheritance
Namespace: Microsoft.EntityFrameworkCore
Assembly: MySql.EntityFrameworkCore.dll
Version: 9.3.0
Syntax
public static class MySQLDbContextOptionsExtensions
Methods
UseMySQL(DbContextOptionsBuilder, Action<MySQLDbContextOptionsBuilder>)
Configures the context to connect to a MySQL database, but without initially setting any
System.
The connection or connection string must be set before the Microsoft.
Declaration
public static DbContextOptionsBuilder UseMySQL(this DbContextOptionsBuilder optionsBuilder, Action<MySQLDbContextOptionsBuilder> mySqlOptionsAction = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
optionsBuilder | The builder being used to configure the context. |
System. |
mySqlOptionsAction | An optional action to enable additional MySQL server-specific configuration. |
Returns
Type | Description |
---|---|
Microsoft. |
The options builder so that further configuration can be chained. |
UseMySQL(DbContextOptionsBuilder, DbConnection, Action<MySQLDbContextOptionsBuilder>)
Configures the context to connect to a MySQL database.
Declaration
public static DbContextOptionsBuilder UseMySQL(this DbContextOptionsBuilder optionsBuilder, DbConnection connection, Action<MySQLDbContextOptionsBuilder> mySqlOptionsAction = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
optionsBuilder | The builder being used to configure the context. |
System. |
connection | An existing System. |
System. |
mySqlOptionsAction | An optional action to enable additional MySQL server-specific configuration. |
Returns
Type | Description |
---|---|
Microsoft. |
The options builder so that further configuration can be chained. |
UseMySQL(DbContextOptionsBuilder, String, Action<MySQLDbContextOptionsBuilder>)
Configures the context used to connect to a MySQL database.
Declaration
public static DbContextOptionsBuilder UseMySQL(this DbContextOptionsBuilder optionsBuilder, string connectionString, Action<MySQLDbContextOptionsBuilder> mySqlOptionsAction = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
optionsBuilder | The builder being used to configure the context. |
System. |
connectionString | The connection string of the database to connect to. |
System. |
mySqlOptionsAction | An optional action to enable additional MySQL server-specific configuration. |
Returns
Type | Description |
---|---|
Microsoft. |
The options builder so that further configuration can be chained. |
UseMySQL<TContext>(DbContextOptionsBuilder<TContext>, Action<MySQLDbContextOptionsBuilder>)
Configures the context to connect to a MySQL database, but without initially setting any
System.
The connection or connection string must be set before the Microsoft.
Declaration
public static DbContextOptionsBuilder<TContext> UseMySQL<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder, Action<MySQLDbContextOptionsBuilder> mySqlOptionsAction = null)
where TContext : DbContext
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
optionsBuilder | The builder being used to configure the context. |
System. |
mySqlOptionsAction | An optional action to enable additional MySQL server-specific configuration. |
Returns
Type | Description |
---|---|
Microsoft. |
The options builder so that further configuration can be chained. |
Type Parameters
Name | Description |
---|---|
TContext |
UseMySQL<TContext>(DbContextOptionsBuilder<TContext>, DbConnection, Action<MySQLDbContextOptionsBuilder>)
Configures the context to connect to a MySQL database.
Declaration
public static DbContextOptionsBuilder<TContext> UseMySQL<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder, DbConnection connection, Action<MySQLDbContextOptionsBuilder> mySqlOptionsAction = null)
where TContext : DbContext
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
optionsBuilder | The builder being used to configure the context. |
System. |
connection | An existing System. |
System. |
mySqlOptionsAction | An optional action to enable additional MySQL server-specific configuration. |
Returns
Type | Description |
---|---|
Microsoft. |
The options builder so that further configuration can be chained. |
Type Parameters
Name | Description |
---|---|
TContext | The type of context to be configured. |
UseMySQL<TContext>(DbContextOptionsBuilder<TContext>, String, Action<MySQLDbContextOptionsBuilder>)
Configures the context to connect to a MySQL database.
Declaration
public static DbContextOptionsBuilder<TContext> UseMySQL<TContext>(this DbContextOptionsBuilder<TContext> optionsBuilder, string connectionString, Action<MySQLDbContextOptionsBuilder> mySqlOptionsAction = null)
where TContext : DbContext
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
optionsBuilder | The builder being used to configure the context. |
System. |
connectionString | The connection string of the database to connect to. |
System. |
mySqlOptionsAction | An optional action to enable additional MySQL server-specific configuration. |
Returns
Type | Description |
---|---|
Microsoft. |
The options builder so that further configuration can be chained. |
Type Parameters
Name | Description |
---|---|
TContext | The type of context to be configured. |