tsbase
    Preparing search index...

    Class Result<T>

    An abstraction of the result of an action or command - Use this pattern to return meaningful results from operations that may have otherwise been void.

    Type Parameters

    • T
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    ErrorMessages: string[] = ...

    Messages indicating why the action returning the result was not successful

    Value?: T

    Accessors

    • get IsSuccess(): boolean

      Indicates whether or not the action returning the result was successful - The lack of errors indicates success. The presence of errors indicates failure.

      Returns boolean

    Methods

    • Adds an error to ErrorMessages only when that error is not already present in the collection

      Parameters

      • error: string

      Returns void