public static IEnumerable <ResultType> SearchModule <ResultType>( Func <CompositeModel, Boolean> matcher, Func <ModuleModel, CompositeModel, ResultType> transformer, ModuleModel moduleModel, Visibility acceptedVisibility ) { // Using AsParallel() here actually slows things down as this is called from within verification, which is run in parallel by itself return(moduleModel.CompositeModelsInThisContainer .Where(model => moduleModel.GetVisibility(model) >= acceptedVisibility && matcher(model)) .Select(model => transformer(moduleModel, model))); }