BeginTransactionInterceptionContext Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents contextual information associated with calls to BeginTransaction(IsolationLevel) implementations.
public class BeginTransactionInterceptionContext : System.Data.Entity.Infrastructure.Interception.DbConnectionInterceptionContext<System.Data.Common.DbTransaction>
type BeginTransactionInterceptionContext = class
inherit DbConnectionInterceptionContext<DbTransaction>
Public Class BeginTransactionInterceptionContext
Inherits DbConnectionInterceptionContext(Of DbTransaction)
- Inheritance
-
BeginTransactionInterceptionContext
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
BeginTransactionInterceptionContext() |
Constructs a new BeginTransactionInterceptionContext with no state. |
BeginTransactionInterceptionContext(DbInterceptionContext) |
Creates a new BeginTransactionInterceptionContext by copying immutable state from the given interception context. Also see Clone() |
Properties
DbContexts |
Gets all the DbContext instances associated with this interception context. (Inherited from DbInterceptionContext) |
Exception |
If this property is set before the operation has executed, then execution of the operation will be suppressed and the set exception will be thrown instead. Otherwise, if the operation fails, then this property will be set to the exception that was thrown. In either case, interceptors that run after the operation can change this property to change the exception that will be thrown, or set this property to null to cause no exception to be thrown at all. (Inherited from MutableInterceptionContext<TResult>) |
IsAsync |
True if the operation is being executed asynchronously, otherwise false. (Inherited from DbInterceptionContext) |
IsExecutionSuppressed |
When true, this flag indicates that that execution of the operation has been suppressed by one of the interceptors. This can be done before the operation has executed by calling SuppressExecution(), by setting an Exception to be thrown, or by setting the operation result using Result. (Inherited from MutableInterceptionContext<TResult>) |
IsolationLevel |
The IsolationLevel that will be used or has been used to start a transaction. |
ObjectContexts |
Gets all the ObjectContext instances associated with this interception context. (Inherited from DbInterceptionContext) |
OriginalException |
If execution of the operation fails, then this property will contain the exception that was thrown. If the operation was suppressed or did not fail, then this property will always be null. (Inherited from MutableInterceptionContext<TResult>) |
OriginalResult |
If execution of the operation completes without throwing, then this property will contain the result of the operation. If the operation was suppressed or did not fail, then this property will always contain the default value for the generic type. (Inherited from MutableInterceptionContext<TResult>) |
Result |
If this property is set before the operation has executed, then execution of the operation will be suppressed and the set result will be returned instead. Otherwise, if the operation succeeds, then this property will be set to the returned result. In either case, interceptors that run after the operation can change this property to change the result that will be returned. (Inherited from MutableInterceptionContext<TResult>) |
TaskStatus |
Set to the status of the Task<TResult> after an async operation has finished. Not used for synchronous operations. (Inherited from MutableInterceptionContext<TResult>) |
UserState |
Obsolete.
Gets or sets a value containing arbitrary user-specified state information associated with the operation. (Inherited from MutableInterceptionContext<TResult>) |
Methods
AsAsync() |
Creates a new BeginTransactionInterceptionContext that contains all the contextual information in this interception context together with 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. (Inherited from MutableInterceptionContext<TResult>) |
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. (Inherited from MutableInterceptionContext<TResult>) |
SuppressExecution() |
Prevents the operation from being executed if called before the operation has executed. (Inherited from MutableInterceptionContext<TResult>) |
ToString() | Returns a string that represents the current object. |
WithDbContext(DbContext) |
Creates a new BeginTransactionInterceptionContext that contains all the contextual information in this interception context with the addition of the given ObjectContext. |
WithIsolationLevel(IsolationLevel) |
Creates a new BeginTransactionInterceptionContext that contains all the contextual information in this interception context together with the given IsolationLevel. |
WithObjectContext(ObjectContext) |
Creates a new BeginTransactionInterceptionContext that contains all the contextual information in this interception context with the addition of the given ObjectContext. |
Applies to
Entity Framework