Beispiel #1
0
        public async Task DeleteAsync(Exercise exercise)
        {
            if (exercise == null)
            {
                return;
            }

            using RepCounterDbContext dbContext = new RepCounterDbContext(DbContextOptions);
            dbContext.Exercises.Remove(exercise);
            await dbContext.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task DeleteAsync(IEnumerable <Exercise> exercises)
        {
            if (exercises == null)
            {
                return;
            }

            using RepCounterDbContext dbContext = new RepCounterDbContext(DbContextOptions);
            foreach (Exercise exercise in exercises)
            {
                if (exercise != null)
                {
                    dbContext.Exercises.Remove(exercise);
                }
            }
            await dbContext.SaveChangesAsync();
        }