RelationalConnectionDependencies 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
RelationalConnectionDependencies(IDbContextOptions, IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, INamedConnectionStringResolver)
为 RelationalConnection创建服务依赖项参数对象。
请勿直接从提供程序或应用程序代码调用此构造函数,因为它可能会随着新依赖项的添加而更改。 相反,请在构造函数中使用此类型,以便由依赖项注入容器自动创建和注入实例。 若要创建替换了某些依赖服务的实例,请首先解析依赖项注入容器中的 对象,然后使用“With...”替换所选服务方法。 请勿在此过程的任何时间点调用构造函数。
public RelationalConnectionDependencies (Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions contextOptions, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> transactionLogger, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> connectionLogger, Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver connectionStringResolver);
new Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies : Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> * Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver -> Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies
Public Sub New (contextOptions As IDbContextOptions, transactionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connectionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection), connectionStringResolver As INamedConnectionStringResolver)
参数
- contextOptions
- IDbContextOptions
当前上下文实例的选项。
- transactionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>
将向其写入事务消息的记录器。
- connectionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Connection>
将向其写入连接消息的记录器。
- connectionStringResolver
- Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver
用于从名称解析连接字符串的服务。
适用于
RelationalConnectionDependencies(IDbContextOptions, IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, INamedConnectionStringResolver, IRelationalTransactionFactory)
为 RelationalConnection创建服务依赖项参数对象。
请勿直接从提供程序或应用程序代码调用此构造函数,因为它可能会随着新依赖项的添加而更改。 相反,请在构造函数中使用此类型,以便由依赖项注入容器自动创建和注入实例。 若要创建替换了某些依赖服务的实例,请首先解析依赖项注入容器中的 对象,然后使用“With...”替换所选服务方法。 请勿在此过程的任何时间点调用构造函数。
public RelationalConnectionDependencies (Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions contextOptions, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> transactionLogger, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> connectionLogger, Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver connectionStringResolver, Microsoft.EntityFrameworkCore.Storage.IRelationalTransactionFactory relationalTransactionFactory);
new Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies : Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> * Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver * Microsoft.EntityFrameworkCore.Storage.IRelationalTransactionFactory -> Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies
Public Sub New (contextOptions As IDbContextOptions, transactionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connectionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection), connectionStringResolver As INamedConnectionStringResolver, relationalTransactionFactory As IRelationalTransactionFactory)
参数
- contextOptions
- IDbContextOptions
当前上下文实例的选项。
- transactionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>
将向其写入事务消息的记录器。
- connectionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Connection>
将向其写入连接消息的记录器。
- connectionStringResolver
- Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver
用于从名称解析连接字符串的服务。
- relationalTransactionFactory
- IRelationalTransactionFactory
用于创建 RelationalTransaction 实例的服务。
适用于
RelationalConnectionDependencies(IDbContextOptions, IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IDiagnosticsLogger<DbLoggerCategory.Database.Connection>, INamedConnectionStringResolver, IRelationalTransactionFactory, ICurrentDbContext)
为 RelationalConnection创建服务依赖项参数对象。
请勿直接从提供程序或应用程序代码调用此构造函数,因为它可能会随着新依赖项的添加而更改。 相反,请在构造函数中使用此类型,以便由依赖项注入容器自动创建和注入实例。 若要创建替换了某些依赖服务的实例,请首先解析依赖项注入容器中的 对象,然后使用“With...”替换所选服务方法。 请勿在此过程的任何时间点调用构造函数。
这是一个支持 Entity Framework Core 基础结构的内部 API,不受与公共 API 相同的兼容性标准的约束。 可能会在任何版本中更改或删除它,而无需通知。 仅应在代码中非常谨慎地直接使用它,并且知道在更新到新的 Entity Framework Core 版本时这样做可能会导致应用程序失败。
[Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkInternal]
public RelationalConnectionDependencies (Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions contextOptions, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> transactionLogger, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> connectionLogger, Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver connectionStringResolver, Microsoft.EntityFrameworkCore.Storage.IRelationalTransactionFactory relationalTransactionFactory, Microsoft.EntityFrameworkCore.Infrastructure.ICurrentDbContext currentContext);
[<Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkInternal>]
new Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies : Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Connection> * Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver * Microsoft.EntityFrameworkCore.Storage.IRelationalTransactionFactory * Microsoft.EntityFrameworkCore.Infrastructure.ICurrentDbContext -> Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies
Public Sub New (contextOptions As IDbContextOptions, transactionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connectionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Connection), connectionStringResolver As INamedConnectionStringResolver, relationalTransactionFactory As IRelationalTransactionFactory, currentContext As ICurrentDbContext)
参数
- contextOptions
- IDbContextOptions
- transactionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>
- connectionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Connection>
- connectionStringResolver
- Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver
- relationalTransactionFactory
- IRelationalTransactionFactory
- currentContext
- ICurrentDbContext
- 属性
适用于
RelationalConnectionDependencies(IDbContextOptions, IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>, IRelationalConnectionDiagnosticsLogger, INamedConnectionStringResolver, IRelationalTransactionFactory, ICurrentDbContext, IRelationalCommandBuilderFactory)
这是一个支持 Entity Framework Core 基础结构的内部 API,不受与公共 API 相同的兼容性标准的约束。 可能会在任何版本中更改或删除它,而无需通知。 仅应在代码中非常谨慎地直接使用它,并且知道在更新到新的 Entity Framework Core 版本时这样做可能会导致应用程序失败。
[Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkInternal]
public RelationalConnectionDependencies (Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions contextOptions, Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> transactionLogger, Microsoft.EntityFrameworkCore.Diagnostics.IRelationalConnectionDiagnosticsLogger connectionLogger, Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver connectionStringResolver, Microsoft.EntityFrameworkCore.Storage.IRelationalTransactionFactory relationalTransactionFactory, Microsoft.EntityFrameworkCore.Infrastructure.ICurrentDbContext currentContext, Microsoft.EntityFrameworkCore.Storage.IRelationalCommandBuilderFactory relationalCommandBuilderFactory);
[<Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkInternal>]
new Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies : Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptions * Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger<Microsoft.EntityFrameworkCore.DbLoggerCategory.Database.Transaction> * Microsoft.EntityFrameworkCore.Diagnostics.IRelationalConnectionDiagnosticsLogger * Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver * Microsoft.EntityFrameworkCore.Storage.IRelationalTransactionFactory * Microsoft.EntityFrameworkCore.Infrastructure.ICurrentDbContext * Microsoft.EntityFrameworkCore.Storage.IRelationalCommandBuilderFactory -> Microsoft.EntityFrameworkCore.Storage.RelationalConnectionDependencies
Public Sub New (contextOptions As IDbContextOptions, transactionLogger As IDiagnosticsLogger(Of DbLoggerCategory.Database.Transaction), connectionLogger As IRelationalConnectionDiagnosticsLogger, connectionStringResolver As INamedConnectionStringResolver, relationalTransactionFactory As IRelationalTransactionFactory, currentContext As ICurrentDbContext, relationalCommandBuilderFactory As IRelationalCommandBuilderFactory)
参数
- contextOptions
- IDbContextOptions
- transactionLogger
- IDiagnosticsLogger<DbLoggerCategory.Database.Transaction>
- connectionLogger
- IRelationalConnectionDiagnosticsLogger
- connectionStringResolver
- Microsoft.EntityFrameworkCore.Storage.Internal.INamedConnectionStringResolver
- relationalTransactionFactory
- IRelationalTransactionFactory
- currentContext
- ICurrentDbContext
- relationalCommandBuilderFactory
- IRelationalCommandBuilderFactory
- 属性
注解
请勿直接从提供程序或应用程序代码调用此构造函数,因为它可能会随着新依赖项的添加而更改。 相反,请在构造函数中使用此类型,以便由依赖项注入容器自动创建和注入实例。 若要创建替换了某些依赖服务的实例,请先解析依赖项注入容器中的 对象,然后使用 C# “with” 运算符替换所选服务。 请勿在此过程的任何时间点调用构造函数。