Interface ICommandProvideInvoker

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

Defines a system that invokes the optional Provide method on a command and returns the values it produces.

public interface ICommandProvideInvoker
Extension Methods

Methods

Invoke(CommandContext, IServiceProvider)

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

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.