TransactionHandler.MatchesParentContext 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
檢查所提供的攔截上下文是否包含目標上下文,或所提供的連線是否與目標上下文所使用的連接相同。
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 否則,
備註
請注意,呼叫此方法會觸發從 interceptionContext