Beispiel #1
0
        public void RemoveSchecduledTaskById(int id)
        {
            ScheduledTask task = _context.Find <ScheduledTask>(id);

            _context.Remove(task);
            _context.SaveChanges();
        }
Beispiel #2
0
        public async Task DeleteAsync(string lessonId)
        {
            var lesson = await _context.ScheduleLessons.SingleOrDefaultAsync(x => x.Id == lessonId);

            if (lesson == default)
            {
                throw new ApplicationException("Не найден");
            }

            _context.Remove(lesson);
            await _context.SaveChangesAsync();
        }