public async Task <Unit> Handle(DeleteCourseCommand request, CancellationToken ct) { var course = await _dbContext.Courses.FindAsync(request.Id); _dbContext.Remove(course); await _dbContext.SaveChangesAsync(); return(default);
public bool Delete(T itemToDelete) { dbContext.Remove <T>(itemToDelete); dbContext.SaveChanges(); return(true); }