DbMigrationsConfiguration.SetHistoryContextFactory Method

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Adds a new factory for creating HistoryContext instances to be used for a given database provider.

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

Syntax

'Declaration
Public Sub SetHistoryContextFactory ( _
    providerInvariantName As String, _
    factory As Func(Of DbConnection, String, HistoryContext) _
)
'Usage
Dim instance As DbMigrationsConfiguration 
Dim providerInvariantName As String 
Dim factory As Func(Of DbConnection, String, HistoryContext)

instance.SetHistoryContextFactory(providerInvariantName, _
    factory)
public void SetHistoryContextFactory(
    string providerInvariantName,
    Func<DbConnection, string, HistoryContext> factory
)
public:
void SetHistoryContextFactory(
    String^ providerInvariantName, 
    Func<DbConnection^, String^, HistoryContext^>^ factory
)
member SetHistoryContextFactory : 
        providerInvariantName:string * 
        factory:Func<DbConnection, string, HistoryContext> -> unit
public function SetHistoryContextFactory(
    providerInvariantName : String, 
    factory : Func<DbConnection, String, HistoryContext>
)

Parameters

  • providerInvariantName
    Type: System.String
    Name of the database provider to set the SQL generator for.

See Also

Reference

DbMigrationsConfiguration Class

System.Data.Entity.Migrations Namespace