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

    Show / Hide Table of Contents

    Class ResultInfo<T, U>

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

    Inheritance
    object
    ResultInfo<T, U>
    Implements
    IEquatable<ResultInfo<T, U>>
    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, U> : IEquatable<ResultInfo<T, U>> where U : Enum
    Type Parameters
    Name Description
    T

    Type of the result

    U

    The severity of the result

    Constructors

    ResultInfo(string, U)

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

    Declaration
    public ResultInfo(string errorMessage, U severity)
    Parameters
    Type Name Description
    string errorMessage

    The error message

    U severity

    The severity of the result

    ResultInfo(T, string, U)

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

    Declaration
    public ResultInfo(T data, string errorMessage, U severity)
    Parameters
    Type Name Description
    T data

    The resulting data or the task

    string errorMessage

    The error message

    U severity

    The severity of the result

    ResultInfo(T, U)

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

    Declaration
    public ResultInfo(T data, U severity)
    Parameters
    Type Name Description
    T data

    The resulting data or the task

    U severity

    The severity of the result

    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

    Severity

    Severity of the result

    Declaration
    public U Severity { get; }
    Property Value
    Type Description
    U

    Implements

    IEquatable<T>

    Extension Methods

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