protected override void Seed(CrowdSourcedNewsDbContext context) { context.Categories.AddOrUpdate( c => c.Name, new Category { Name = "Sports" }, new Category { Name = "Politics" }, new Category { Name = "Food" }, new Category { Name = "International" }, new Category { Name = "Local" }, new Category { Name = "Business" }, new Category { Name = "Economy" }, new Category { Name = "Education" }, new Category { Name = "Health" }, new Category { Name = "Celebrity" }); }
public static void Initialize() { Database.SetInitializer(new MigrateDatabaseToLatestVersion <CrowdSourcedNewsDbContext, Configuration>()); CrowdSourcedNewsDbContext.Create().Database.Initialize(true); }