Example #1
0
        public static void EnsureSeedData(this VotingContext context)
        {
            if (!context.AllMigrationsApplied())
            {
                return;
            }

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

                context.SeedVersions();
                context.SeedJudete();
                context.SeedSectiune();
                context.SeedOptiuni();
                context.SeedQuestions('A');
                context.SeedQuestions('B');
                context.SeedQuestions('C');

                tran.Commit();
            }
        }