Class CommandExtensions
Extension methods for the ICommand interface.
public static class CommandExtensions
- Inheritance
-
objectCommandExtensions
Methods
ToMessage<T>(T, Uri, string, Action<MessageOptions>)
Encloses the specified command to an instance of Message<T>.
public static IMessage<T> ToMessage<T>(this T command, Uri source, string type, Action<MessageOptions> setup = null) where T : ICommand
Parameters
commandTThe payload to attach within the message.
sourceUriThe context that describes the origin of the message.
typestringThe type that describes the type of
commandrelated to the originating occurrence.setupAction<MessageOptions>The MessageOptions which may be configured.
Returns
- IMessage<T>
An instance of Message<T> constraint to the ICommand interface.
Type Parameters
TThe type of the payload constraint to the ICommand interface.
Exceptions
- ArgumentNullException
commandcannot be null - or -sourcecannot be null.- ArgumentException
setupfailed to configure an instance of MessageOptions in a valid state.