public static void EnsureSeedData(this VotingContext context) { if (!context.AllMigrationsApplied()) { return; } using (var tran = context.Database.BeginTransaction()) { context.DataCleanUp(); context.SeedNGOs(); context.SeedVersions(); context.SeedCounties(); context.SeedFormSections(); context.SeedOptions(); context.SeedQuestions('A'); context.SeedQuestions('B'); context.SeedQuestions('C'); tran.Commit(); } }