Beispiel #1
0
        static void deleteAll()
        {
            using (EFCoreContext db = new EFCoreContext())
            {
                db.RemoveRange(db.Departments.ToList());
                db.RemoveRange(db.Employees.ToList());
                db.RemoveRange(db.Regions.ToList());
                db.RemoveRange(db.Territories.ToList());
                db.RemoveRange(db.SalesPersons.ToList());

                db.SaveChanges();
            }
        }