共用方式為


TransactionHandler.MatchesParentContext 方法

定義

檢查提供的攔截內容是否包含目標內容,或提供的連線與目標內容所使用的連接相同。

protected internal virtual bool MatchesParentContext(System.Data.Common.DbConnection connection, System.Data.Entity.Infrastructure.Interception.DbInterceptionContext interceptionContext);
abstract member MatchesParentContext : System.Data.Common.DbConnection * System.Data.Entity.Infrastructure.Interception.DbInterceptionContext -> bool
override this.MatchesParentContext : System.Data.Common.DbConnection * System.Data.Entity.Infrastructure.Interception.DbInterceptionContext -> bool
Protected Friend Overridable Function MatchesParentContext (connection As DbConnection, interceptionContext As DbInterceptionContext) As Boolean

參數

connection
DbConnection

連接。

interceptionContext
DbInterceptionContext

攔截內容。

傳回

true 如果提供的攔截內容包含目標內容,或提供的連線與目標內容所使用的連接相同,則提供攔截內容不包含任何內容; false 否則。

備註

請注意,呼叫此方法會觸發從 參考的任何 DbCoNtext 初始化 interceptionContext

適用於