Table of Contents

Class EntryCommand<TEndpoint>

Namespace
TypedRest.CommandLine.Commands
Assembly
TypedRest.CommandLine.dll

Command providing an entry point to a hierarchy of named IEndpointCommands.

public class EntryCommand<TEndpoint> : EndpointCommand<TEndpoint>, IEndpointCommand, IEnumerable<KeyValuePair<string, Func<TEndpoint, IEndpointCommand>>>, IEnumerable where TEndpoint : IEndpoint

Type Parameters

TEndpoint
Inheritance
EndpointCommand<TEndpoint>
EntryCommand<TEndpoint>
Implements
Inherited Members

Constructors

EntryCommand(TEndpoint)

Command providing an entry point to a hierarchy of named IEndpointCommands.

public EntryCommand(TEndpoint endpoint)

Parameters

endpoint TEndpoint

The endpoint this command operates on.

Methods

Add(string, Func<TEndpoint, IEndpointCommand>)

public void Add(string name, Func<TEndpoint, IEndpointCommand> commandProvider)

Parameters

name string
commandProvider Func<TEndpoint, IEndpointCommand>

ExecuteInnerAsync(IReadOnlyList<string>, CancellationToken)

Parses command-line arguments and executes the resulting operation when no additional sub-IEndpointCommand is specified.

protected override Task ExecuteInnerAsync(IReadOnlyList<string> args, CancellationToken cancellationToken = default)

Parameters

args IReadOnlyList<string>

the console arguments.

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<KeyValuePair<string, Func<TEndpoint, IEndpointCommand>>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, Func<TEndpoint, IEndpointCommand>>>

An enumerator that can be used to iterate through the collection.

GetSubCommand(string)

Creates a sub-IEndpointCommand based on the given name.

protected override IEndpointCommand? GetSubCommand(string name)

Parameters

name string

Returns

IEndpointCommand

The IEndpointCommand or null if the name does not match.