Class StreamingCollectionCommand<TEntity, TEndpoint, TElementEndpoint, TElementCommand>
- Namespace
- TypedRest.CommandLine.Commands.Reactive
- Assembly
- TypedRest.CommandLine.dll
Command operating on a IStreamingCollectionEndpoint<TEntity, TElementEndpoint>.
public abstract class StreamingCollectionCommand<TEntity, TEndpoint, TElementEndpoint, TElementCommand> : CollectionCommand<TEntity, TEndpoint, TElementEndpoint, TElementCommand>, IEndpointCommand where TEntity : class where TEndpoint : IStreamingCollectionEndpoint<TEntity, TElementEndpoint> where TElementEndpoint : IElementEndpoint<TEntity> where TElementCommand : IEndpointCommand
Type Parameters
TEntity
The type of entity the endpoint represents.
TEndpoint
The specific type of IStreamingCollectionEndpoint<TEntity, TElementEndpoint> to operate on.
TElementEndpoint
The specific type of IElementEndpoint<TEntity> the
TEndpoint
provides for individualTEntity
s.TElementCommand
The specific type of IEndpointCommand is used to handle
TElementEndpoint
s. Must have a public constructor with aTElementEndpoint
parameter.
- Inheritance
-
EndpointCommand<TEndpoint>IndexerCommand<TEndpoint, TElementEndpoint, TElementCommand>CollectionCommand<TEntity, TEndpoint, TElementEndpoint, TElementCommand>StreamingCollectionCommand<TEntity, TEndpoint, TElementEndpoint, TElementCommand>
- Implements
- Derived
- Inherited Members
Constructors
StreamingCollectionCommand(TEndpoint)
Command operating on a IStreamingCollectionEndpoint<TEntity, TElementEndpoint>.
protected StreamingCollectionCommand(TEndpoint endpoint)
Parameters
endpoint
TEndpointThe endpoint this command operates on.
Methods
ExecuteAsync(IReadOnlyList<string>, CancellationToken)
Parses command-line arguments and executes the resulting operation.
public override Task ExecuteAsync(IReadOnlyList<string> args, CancellationToken cancellationToken = default)
Parameters
args
IReadOnlyList<string>the console arguments.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
OutputEntitiesAsync(IObservable<TEntity>, CancellationToken)
Outputs a stream of TEntity
s to the user, e.g., via ToString() on the console.
protected virtual Task OutputEntitiesAsync(IObservable<TEntity> observable, CancellationToken cancellationToken = default)
Parameters
observable
IObservable<TEntity>cancellationToken
CancellationToken