Example #1
0
        protected override void Seed(StuContext.StuDBContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
            //  to avoid creating duplicate seed data.
            context.Database.ExecuteSqlCommand("delete Students");
            context.Database.ExecuteSqlCommand("delete DepartMents");
            DepartMentSeed.Seed(context);
            StudentSeed.Seed(context);
        }
Example #2
0
 protected override void Seed(StuContext.StuDBContext context)
 {
     DepartmentSeed.Seed(context);
     StudentSeed.Seed(context);
 }