Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //C# Pipeline example
- var tasks = myObject
- .Select(o => o.MyString)
- .Where(s => s != null)
- .Select(s => new Request() { Message = s })
- .Select(r => r.Send(mediator))
- .ToArray();
- await Task.WhenAll(tasks); //There should be an extension `Task WhenAll(this IEnumerable<Task>)`
- //C# Non-Pipeline example
- await Task.WhenAll(
- Enumerable.ToArray(
- Enumerable.Select(
- Enumerable.Select(
- Enumerable.Where(
- Enumerable.Select(
- myObject,
- o => o.MyString
- ),
- s=> s != null
- ),
- s => new Request() { Message = s }
- ),
- r => mediator.Send(r)
- ),
- )
- );
- //PowerShell Pipeline example
- Get-Process notepad `
- | Stop-Process
- //PowerShell Non-Pipeline example
- Stop-Process -InputObject ( `
- Get-Process notepad `
- )
Add Comment
Please, Sign In to add comment