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
activitySourceIActivitySource<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
contextCommandContextThe CommandContext for the command being handled.
serviceProviderIServiceProviderThe IServiceProvider used to resolve the
Providemethod's parameters.
Returns
- ValueTask<IReadOnlyList<object>>
The non-null values produced by the
Providemethod (a single value, or each element of a returned tuple), or an empty collection when the command has noProvidemethod.