DbCommandTreeInterceptionContext Class

Definition

Represents contextual information associated with calls into IDbCommandTreeInterceptor implementations.

public class DbCommandTreeInterceptionContext : System.Data.Entity.Infrastructure.Interception.DbInterceptionContext
type DbCommandTreeInterceptionContext = class
    inherit DbInterceptionContext
Public Class DbCommandTreeInterceptionContext
Inherits DbInterceptionContext
Inheritance
DbCommandTreeInterceptionContext

Remarks

Instances of this class are publicly immutable for contextual information. To add contextual information use one of the With... or As... methods to create a new interception context containing the new information.

Constructors

DbCommandTreeInterceptionContext()

Constructs a new DbCommandTreeInterceptionContext with no state.

DbCommandTreeInterceptionContext(DbInterceptionContext)

Creates a new DbCommandTreeInterceptionContext by copying state from the given interception context. Also see Clone()

Properties

DbContexts

Gets all the DbContext instances associated with this interception context.

(Inherited from DbInterceptionContext)
IsAsync

True if the operation is being executed asynchronously, otherwise false.

(Inherited from DbInterceptionContext)
ObjectContexts

Gets all the ObjectContext instances associated with this interception context.

(Inherited from DbInterceptionContext)
OriginalResult

The original tree created by Entity Framework. Interceptors can change the Result property to change the tree that will be used, but the OriginalResult will always be the tree created by Entity Framework.

Result

The command tree that will be used by Entity Framework. This starts as the tree contained in the the OriginalResult property but can be set by interceptors to change the tree that will be used by Entity Framework.

UserState
Obsolete.

Gets or sets a value containing arbitrary user-specified state information associated with the operation.

Methods

AsAsync()

Creates a new DbCommandTreeInterceptionContext that contains all the contextual information in this interception context the IsAsync flag set to true.

Clone()

Call this method when creating a copy of an interception context in order to add new state to it. Using this method instead of calling the constructor directly ensures virtual dispatch so that the new type will have the same type (and any specialized state) as the context that is being cloned.

Equals(Object)

Determines whether the specified object is equal to the current object.

FindUserState(String)

Gets a value containing arbitrary user-specified state information associated with the operation.

GetHashCode()

Serves as the default hash function.

GetType()

Gets the Type of the current instance.

SetUserState(String, Object)

Sets a value containing arbitrary user-specified state information associated with the operation.

ToString()

Returns a string that represents the current object.

WithDbContext(DbContext)

Creates a new DbCommandTreeInterceptionContext that contains all the contextual information in this interception context with the addition of the given DbContext.

WithObjectContext(ObjectContext)

Creates a new DbCommandTreeInterceptionContext that contains all the contextual information in this interception context with the addition of the given ObjectContext.

Applies to