HistoryContext, constructeur
[Cette page concerne Entity Framework version 6. La dernière version est disponible sous le nom de package 'Entity Framework' NuGet. Pour plus d'informations sur Entity Framework, consultez msdn.com/data/ef.]
Initialise une nouvelle instance de la classe HistoryContext. Si vous créez un contexte historique dérivé, vous exposez généralement un constructeur qui accepte ces mêmes paramètres et les passe à ce constructeur de base.
Espace de noms : System.Data.Entity.Migrations.History
Assembly : EntityFramework (dans EntityFramework.dll)
Syntaxe
'Déclaration
<SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
Public Sub New ( _
existingConnection As DbConnection, _
defaultSchema As String _
)
'Utilisation
Dim existingConnection As DbConnection
Dim defaultSchema As String
Dim instance As New HistoryContext(existingConnection, _
defaultSchema)
[SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public HistoryContext(
DbConnection existingConnection,
string defaultSchema
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA2214:DoNotCallOverridableMethodsInConstructors")]
public:
HistoryContext(
DbConnection^ existingConnection,
String^ defaultSchema
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")>]
new :
existingConnection:DbConnection *
defaultSchema:string -> HistoryContext
public function HistoryContext(
existingConnection : DbConnection,
defaultSchema : String
)
Paramètres
- existingConnection
Type : System.Data.Common.DbConnection
Connexion existante à utiliser pour le nouveau contexte.
- defaultSchema
Type : System.String
Schéma par défaut du modèle migré. Ce schéma est utilisé pour la table de l'historique des migrations, sauf si un schéma différent est configuré dans OnModelCreating.