Share via


DbMigrationsConfiguration.SetHistoryContextFactory Method

Definition

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

public void SetHistoryContextFactory (string providerInvariantName, Func<System.Data.Common.DbConnection,string,System.Data.Entity.Migrations.History.HistoryContext> factory);
member this.SetHistoryContextFactory : string * Func<System.Data.Common.DbConnection, string, System.Data.Entity.Migrations.History.HistoryContext> -> unit
Public Sub SetHistoryContextFactory (providerInvariantName As String, factory As Func(Of DbConnection, String, HistoryContext))

Parameters

providerInvariantName
String

Name of the database provider to set the SQL generator for.

factory
Func<DbConnection,String,HistoryContext>

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

Applies to