Exemplo n.º 1
0
        public static void EnsureSeedData(this VotingContext context)
        {
            if (!context.AllMigrationsApplied())
            {
                return;
            }

            using (var tran = context.Database.BeginTransaction())
            {
                context.DataCleanUp();

                context.SeedVersions();
                context.SeedCounties();
                context.SeedFormSections();
                context.SeedOptions();
                context.SeedQuestions('A');
                context.SeedQuestions('B');
                context.SeedQuestions('C');

                tran.Commit();
            }
        }