Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.

Readme.md

EntityFramework.DatabaseMigrator

NuGet Packages

Install-Package EntityFramework.DatabaseMigrator

Back story and additional details available here.

Instructions

Assuming you already have migrations enabled,

  1. Add a new WinForms project to your solution.

  2. Delete the form automatically added to the new project.

  3. Open program.cs in the root of your project and change Form1 to EntityFramework.DatabaseMigrator.DatabaseMigrator

        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new EntityFramework.DatabaseMigrator.DatabaseMigrator());
            }
        }
  4. Change your migration configuration to inherit from BaseMigrationConfiguration or add and implement the IMigrationConfiguration interface.

    internal sealed class Configuration : BaseMigrationConfiguration<EntityFramework.DatabaseMigrator.Example.Data.BlogContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
            ContextKey = "EntityFramework.DatabaseMigrator.Example.Data.BlogContext";
        }
    }

About

EntityFramework.DatabaseMigrator is a WinForms utility to help manage Entity Framework 6.0+ migrations.

Resources

License

Releases

No releases published
You can’t perform that action at this time.