To create a 1-click process for deployment, I am using the following code:
Public Class MyDBContext: DbContext {Public MyDBContext (): Base ("MyDBContext") {Database.SetInitializer & lt; MyDBContext & gt; (New MigrateDatabaseToLatestVersion & lt; MyDBContext, Configuration & gt; ()); } Public DbSet ..} Public class configuration: DbMigrationsConfiguration & lt; MyDBContext & gt; {Public Configuration () {AutomaticMgrrans Enabled = True; AutomaticMigrationDataLossAllowed = True; }}
I can add a seed method in the future
In the case of performance, will the applicant be better at calling this beginner at startup or Will EF be smart so that it will know that nothing has changed?
Migration, and possible performance issues, is this a bad idea?
No comments:
Post a Comment