I have raised this problem as well as in addition, I did not want to loosen the __magentising table from the database .
I suggested to use this "super" reference, in which all DbSet, See me a simple and easy solution, my answer below. First of all, you should create the "super" reference migration configuration. Then just create the following category: Now you will not get this error further, plus, your migration-history will be, and you will use multiple references on one database.
MySuperContext: DbContext {// All DbSet & lt; & Gt; One of your different references must be mentioned here, you will only use this class for migration. Public MySuperContext (): Base ("YourConnectionString") {System.Data.Entity.Database.SetInitializer (New MigrateDatabaseOutoteStarson & lt; MySpore Contact, Migration Confirmation & gt; ()); }}
Public class NoDatabaseInitializer & lt; T & gt; : IDBS Starter & lt; T & gt; Where T: DbContext {public zero initial database (T reference) {// Nothing, this means! Now, in every small context, add it to the constructor:
class MyUserContext: DbContext {public MyUserContext: base ("MyConnectionString" ) // can be a user reference, etc. {System.Data.Entity.Database.SetInitializer (new nodeadvertiseriilizer & lt; MyContext & gt; ()); }}
No comments:
Post a Comment