Table of Contents

Class StreamPrinter<TEntity>

Namespace
TypedRest.CommandLine.IO
Assembly
TypedRest.CommandLine.dll

Prints a stream of TEntitys to an IConsole.

public class StreamPrinter<TEntity> : IObserver<TEntity>

Type Parameters

TEntity
Inheritance
object
StreamPrinter<TEntity>
Implements
IObserver<TEntity>

Constructors

StreamPrinter(IConsole)

Prints a stream of TEntitys to an IConsole.

public StreamPrinter(IConsole console)

Parameters

console IConsole

The console to print to.

Methods

OnCompleted()

public void OnCompleted()

OnError(Exception)

Reprots an error to the user via the console.

public virtual void OnError(Exception error)

Parameters

error Exception

OnNext(TEntity)

Outputs a TEntity to the user via the console.

public virtual void OnNext(TEntity value)

Parameters

value TEntity

PrintAsync(IObservable<TEntity>, CancellationToken)

Prints all entities provided by the observable to the JsonConsole.

public Task PrintAsync(IObservable<TEntity> observable, CancellationToken cancellationToken)

Parameters

observable IObservable<TEntity>
cancellationToken CancellationToken

Returns

Task

Remarks

This method is only intended to be called once per class instance.