Share via


TransactionHandler.MatchesParentContext Method

Definition

Checks whether the supplied interception context contains the target context or the supplied connection is the same as the one used by the target context.

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

Parameters

connection
DbConnection

A connection.

interceptionContext
DbInterceptionContext

An interception context.

Returns

true if the supplied interception context contains the target context or the supplied connection is the same as the one used by the target context if the supplied interception context doesn't contain any contexts; false otherwise.

Remarks

Note that calling this method will trigger initialization of any DbContext referenced from the interceptionContext

Applies to