private Task TransformInputSource(IInputSource inputSource, List <IPipeline> pipelines) { return(Task.WhenAll( inputSource .Get(this) .Select(i => { foreach (var pipeline in pipelines) { if (pipeline.Accept(this, i)) { return pipeline.TransformAsync(this, i); } } return Task.CompletedTask; }))); }
private Task <InputItems[]> PrepareInputSource(IInputSource inputSource, List <IPipeline> pipelines) { return(Task.WhenAll( inputSource .Get(this) .Select(i => { foreach (var pipeline in pipelines) { if (pipeline.Accept(this, i)) { return pipeline.PrepareAsync(this, i); } } return Task.FromResult(InputItems.Empty); }))); }