private IEnumerable <Result> Query(string program, string programArguments) { var result = _win32ProgramRepository .Concat <IProgram>(_packageRepository) .AsParallel() .Where(p => p.Enabled) .Select(p => p.Result(program, programArguments, _context.API)) .Where(r => r?.Score > 0) .ToArray(); return(Enumerable.Empty <Result>()); }
private IEnumerable <Result> Query(string program, string programArguments) { var result = _win32ProgramRepository .Concat <IProgram>(_packageRepository) .AsParallel() .Where(p => p.Enabled) .Select(p => p.Result(program, programArguments, _context.API)) .Where(r => r?.Score > 0) .ToArray(); if (result.Any()) { var maxScore = result.Max(x => x.Score); return(result .Where(x => x.Score > Settings.MinScoreThreshold * maxScore)); } return(Enumerable.Empty <Result>()); }