METHOD

WithCancellation

Supplies a cancellation token to asynchronous enumeration.

Formal Syntax & Structure

csharp syntaxcsharp
source.WithCancellation(token)

Working Example

Example Snippetcsharp
// Documentary fragment; see lesson for context and imports.Read().WithCancellation(stop.Token)
C# & .NET Reference