private static void Seed(DefaultDbContext context) { string sqlPath = string.Format(AppDomain.CurrentDomain.BaseDirectory + "{0}", "/Infrastructure/Initializers/Sql/Development/"); var sqlFiles = Directory.GetFiles(sqlPath, "*.sql"); foreach (string file in sqlFiles) { context.Database.ExecuteSqlCommand(File.ReadAllText(file)); } }
public static void Setup(DefaultDbContext context) { Seed(context); context.SaveChanges(); }