DbConfiguration.SetDefaultTransactionHandler Method (Func<TransactionHandler>)

 

Call this method from the constructor of a class derived from DbConfiguration to register a TransactionHandler.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

protected internal void SetDefaultTransactionHandler(
	Func<TransactionHandler> transactionHandlerFactory
)

Parameters

transactionHandlerFactory
Type: System.Func<TransactionHandler>

A function that returns a new instance of a transaction handler.

This method is provided as a convenient and discoverable way to add configuration to the Entity Framework. Internally it works in the same way as using AddDependencyResolver to add an appropriate resolver for TransactionHandler. This means that, if desired, the same functionality can be achieved using a custom resolver or a resolver backed by an Inversion-of-Control container.