7
複数のコンテキストのEF移行を有効にしてデータベースを分離するにはどうすればよいですか?
同じコンテキスト内の複数のDBコンテキストに対してEntity Framework 5(バージョン5.0.0)の移行を有効にするにはどうすればよいですか(各コンテキストは独自のデータベースに対応しています)?Enable-MigrationsPMコンソール(Visual Studio 2012)で実行すると、複数のコンテキストがあるためエラーが発生します。 PM> Enable-Migrations More than one context type was found in the assembly 'DatabaseService'. To enable migrations for DatabaseService.Models.Product1DbContext, use Enable-Migrations -ContextTypeName DatabaseService.Models.Product1DbContext. To enable migrations for DatabaseService.Models.Product2DbContext, use Enable-Migrations -ContextTypeName DatabaseService.Models.Product2DbContext. 私が実行した場合Enable-Migrations -ContextTypeName DatabaseService.Models.Product1DbContext、私は実行することはできませんよEnable-Migrations -ContextTypeName DatabaseService.Models.Product2DbContext移行がすでに存在するため:Migrations have already been enabled in project 'DatabaseService'. To overwrite …