Class CommandKeys
- Namespace
- Cratis.Arc.Commands
- Assembly
- Cratis.Arc.Core.dll
Represents an implementation of ICommandKeys that asks each ICanResolveKeyForCommand in turn.
[Singleton]
public class CommandKeys : ICommandKeys
- Inheritance
-
CommandKeys
- Implements
- Inherited Members
- Extension Methods
Remarks
The rule Arc ships is asked last regardless of the order the rules are discovered in, so an application's own rule always decides and the outcome never depends on discovery order.
Constructors
CommandKeys(IInstancesOf<ICanResolveKeyForCommand>)
Represents an implementation of ICommandKeys that asks each ICanResolveKeyForCommand in turn.
public CommandKeys(IInstancesOf<ICanResolveKeyForCommand> resolvers)
Parameters
resolversIInstancesOf<ICanResolveKeyForCommand>The rules for reading a key from a command.
Remarks
The rule Arc ships is asked last regardless of the order the rules are discovered in, so an application's own rule always decides and the outcome never depends on discovery order.
Methods
GetKeyFor(object)
Gets the key a command identifies its target by.
public string? GetKeyFor(object command)
Parameters
commandobjectThe command to read.
Returns
- string
The key, or null when no rule recognizes one on the command.