private static void DeleteStudentsFromClasses(ClassDB ctx) { var students = ctx.Students.ToList(); foreach (var student in students) { ctx.DeleteObject(student); } ctx.SaveChanges(); }
private static void DeleteClasses(ClassDB ctx) { var classes = ctx.Classes.ToList(); foreach (var @class in classes) { ctx.DeleteObject(@class); } ctx.SaveChanges(); }