示例#1
0
        public static void RemoveDbSetDataDatabase(this CapstoneContext context, DbSet set)
        {
            var dataDeleter = new DatabaseDataDeleter(context);

            RemoveDbSetData(set);
            context.SaveChanges();

            dataDeleter.DeleteAllObjects();
        }
示例#2
0
        public static void RemoveAllDbSetDataDatabase(this CapstoneContext context)
        {
            var dataDeleter = new DatabaseDataDeleter(context);

            RemoveDbSetData(context.Events);
            RemoveDbSetData(context.EventType);
            RemoveDbSetData(context.Category);
            RemoveDbSetData(context.Registrations);
            RemoveDbSetData(context.Statuses);
            context.SaveChanges();

            dataDeleter.DeleteAllObjects();
        }