Class CommandProvideInvoker

Namespace
Cratis.Arc.Commands
Assembly
Cratis.Arc.Core.dll

Represents an implementation of ICommandProvideInvoker.

[Singleton]
public class CommandProvideInvoker : ICommandProvideInvoker
Inheritance
CommandProvideInvoker
Implements
Inherited Members
Extension Methods

Constructors

CommandProvideInvoker()

Initializes a new instance of the CommandProvideInvoker class, without tracing.

public CommandProvideInvoker()

CommandProvideInvoker(IActivitySource<CommandProvideInvoker>)

Initializes a new instance of the CommandProvideInvoker class.

public CommandProvideInvoker(IActivitySource<CommandProvideInvoker> activitySource)

Parameters

activitySource IActivitySource<CommandProvideInvoker>

The IActivitySource<T> to trace Provide() on.

Methods

Invoke(CommandContext, IServiceProvider)

Invokes the Provide method on the command in the given CommandContext, if it has one.

public ValueTask<IReadOnlyList<object>> Invoke(CommandContext context, IServiceProvider serviceProvider)

Parameters

context CommandContext

The CommandContext for the command being handled.

serviceProvider IServiceProvider

The IServiceProvider used to resolve the Provide method's parameters.

Returns

ValueTask<IReadOnlyList<object>>

The non-null values produced by the Provide method (a single value, or each element of a returned tuple), or an empty collection when the command has no Provide method.