Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DbConfiguration::SetDefaultHistoryContext Method (Func<DbConnection^, String^, HistoryContext^>^)

Entity Framework 6.0
 

Call this method from the constructor of a class derived from DbConfiguration to set a Func<T1, T2, TResult> delegate which which be used for creation of the default HistoryContext for a any DbMigrationsConfiguration. This default factory will only be used if no factory is set explicitly in the DbMigrationsConfiguration and if no factory has been registered for the provider in use using the SetHistoryContext method.

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

public protected:
void SetDefaultHistoryContext(
	Func<DbConnection^, String^, HistoryContext^>^ factory
)

Parameters

factory
Type: System::Func<DbConnection^, String^, HistoryContext^>^

A factory for creating HistoryContext instances for a given DbConnection and String representing the default schema.

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 Func<T1, T2, TResult>. 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.

Return to top
Show: