public void RemoveSchecduledTaskById(int id) { ScheduledTask task = _context.Find <ScheduledTask>(id); _context.Remove(task); _context.SaveChanges(); }
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(); }