DevToys logo DevToys
  • Home
  • Blog
  • Documentation
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ResultInfo<T>

    Record to contain both whether the task was a success and the resulting data

    Inheritance
    object
    ResultInfo<T>
    Implements
    IEquatable<ResultInfo<T>>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DevToys.Api
    Assembly: DevToys.Api.dll
    Syntax
    public record ResultInfo<T> : IEquatable<ResultInfo<T>>
    Type Parameters
    Name Description
    T

    Type of the result

    Constructors

    ResultInfo(T, bool)

    Record to contain both whether the task was a success and the resulting data

    Declaration
    public ResultInfo(T data, bool hasSucceeded = true)
    Parameters
    Type Name Description
    T data

    The resulting data or the task

    bool hasSucceeded

    Whether the task succeeded

    ResultInfo(T, string, bool)

    Record to contain both whether the task was a success and the resulting data

    Declaration
    public ResultInfo(T data, string errorMessage, bool hasSucceeded = false)
    Parameters
    Type Name Description
    T data

    The resulting data or the task

    string errorMessage

    The error message

    bool hasSucceeded

    Whether the task succeeded

    Properties

    Data

    The resulting data or the task

    Declaration
    public T? Data { get; }
    Property Value
    Type Description
    T

    ErrorMessage

    Error message to display

    Declaration
    public string? ErrorMessage { get; }
    Property Value
    Type Description
    string

    HasSucceeded

    Whether the task succeeded

    Declaration
    public bool HasSucceeded { get; }
    Property Value
    Type Description
    bool

    Implements

    IEquatable<T>

    Extension Methods

    LoggingExtensions.Log<T>(T)
    In this article
    DevToys logo © 2024 DevToys