Class CommandExecutionResult
Represents a generic command execution result.
Namespace: TehGM.Wolfringo.Commands.Results
Assembly: Wolfringo.Commands.dll
Syntax
public class CommandExecutionResult : IMessagesCommandResult, ICommandResult
Constructors
| Improve this Doc View SourceCommandExecutionResult(Boolean, IEnumerable<String>, Exception)
Creates a new result instance.
Declaration
[Obsolete("Use constructor with status arg instead.")]
public CommandExecutionResult(bool isSuccess, IEnumerable<string> messages, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isSuccess | Whether execution was successful. |
IEnumerable<String> | messages | Error messages to reply with. |
Exception | exception | Exception that resulted in given status. |
Remarks
This constructor has been obsoleted in favour of Status approach and will be removed in future updates.
CommandExecutionResult(CommandResultStatus, IEnumerable<String>, Exception)
Creates a new result instance.
Declaration
public CommandExecutionResult(CommandResultStatus status, IEnumerable<string> messages, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
CommandResultStatus | status | The execution status. |
IEnumerable<String> | messages | Error messages to reply with. |
Exception | exception | Exception that resulted in given status. |
Remarks
This constructor has been obsoleted in favour of Status approach and will be removed in future updates.
Fields
| Improve this Doc View SourceFailure
Shared failure result.
Declaration
public static readonly CommandExecutionResult Failure
Field Value
Type | Description |
---|---|
CommandExecutionResult |
Skip
Shared skip result.
Declaration
public static readonly CommandExecutionResult Skip
Field Value
Type | Description |
---|---|
CommandExecutionResult |
Success
Shared success result.
Declaration
public static readonly CommandExecutionResult Success
Field Value
Type | Description |
---|---|
CommandExecutionResult |
Properties
| Improve this Doc View SourceException
An exception that has occured.
Declaration
public Exception Exception { get; }
Property Value
Type | Description |
---|---|
Exception |
Remarks
CommandExecutionResult provides exception, as there are 2 ways commands could be executed - from background thread, or invoked on public method. Those invoked on public method should throw always, while those invoked by background thread shouldn't, as this will allow more selective logging.
IsSuccess
Whether execution or check was successful.
Declaration
[Obsolete("Use Status property instead.")]
public bool IsSuccess { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This property has been obsoleted in favour of Status and will be removed in future updates.
Messages
Set of messages to reply with.
Declaration
public IEnumerable<string> Messages { get; }
Property Value
Type | Description |
---|---|
IEnumerable<String> |
Status
Status telling commands service how to progress with the execution.
Declaration
public CommandResultStatus Status { get; }
Property Value
Type | Description |
---|---|
CommandResultStatus |
Methods
| Improve this Doc View SourceFromException(Exception, IEnumerable<String>)
Creates a failure result with exception and optional messages.
Declaration
public static CommandExecutionResult FromException(Exception exception, IEnumerable<string> messages = null)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception that is cause of a failure. |
IEnumerable<String> | messages | Messages to respond with. |
Returns
Type | Description |
---|---|
CommandExecutionResult | A new failure result. |