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' 運算子取代選取的服務。 請勿在此進程中的任何時間點呼叫建構函式。