Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class CommandExecutionResult

    Represents a generic command execution result.

    Inheritance
    System.Object
    CommandExecutionResult
    Implements
    IMessagesCommandResult
    ICommandResult
    Namespace: TehGM.Wolfringo.Commands.Results
    Assembly: Wolfringo.Commands.dll
    Syntax
    public class CommandExecutionResult : IMessagesCommandResult, ICommandResult

    Constructors

    | Improve this Doc View Source

    CommandExecutionResult(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
    System.Boolean isSuccess

    Whether execution was successful.

    System.Collections.Generic.IEnumerable<System.String> messages

    Error messages to reply with.

    System.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.

    | Improve this Doc View Source

    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.

    System.Collections.Generic.IEnumerable<System.String> messages

    Error messages to reply with.

    System.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 Source

    Failure

    Shared failure result.

    Declaration
    public static readonly CommandExecutionResult Failure
    Field Value
    Type Description
    CommandExecutionResult
    | Improve this Doc View Source

    Skip

    Shared skip result.

    Declaration
    public static readonly CommandExecutionResult Skip
    Field Value
    Type Description
    CommandExecutionResult
    | Improve this Doc View Source

    Success

    Shared success result.

    Declaration
    public static readonly CommandExecutionResult Success
    Field Value
    Type Description
    CommandExecutionResult

    Properties

    | Improve this Doc View Source

    Exception

    An exception that has occured.

    Declaration
    public Exception Exception { get; }
    Property Value
    Type Description
    System.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.

    | Improve this Doc View Source

    IsSuccess

    Whether execution or check was successful.

    Declaration
    [Obsolete("Use Status property instead.")]
    public bool IsSuccess { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    This property has been obsoleted in favour of Status and will be removed in future updates.

    | Improve this Doc View Source

    Messages

    Set of messages to reply with.

    Declaration
    public IEnumerable<string> Messages { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.String>
    | Improve this Doc View Source

    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 Source

    FromException(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
    System.Exception exception

    Exception that is cause of a failure.

    System.Collections.Generic.IEnumerable<System.String> messages

    Messages to respond with.

    Returns
    Type Description
    CommandExecutionResult

    A new failure result.

    Implements

    IMessagesCommandResult
    ICommandResult