Skip to content

Improve Result types #27

@FelixCCWork

Description

@FelixCCWork
  • Make Result to Result conversion explicit, to prevent loosing of information. Check if we can add a .ToResult convertion method.

    public static implicit operator Result(Result<T> result)

  • Check if we want to add auto deconstruct like var (isOk, value) = UpdateDb(entity);

  • Check if we can add a Result variant without error message as most of the time we return a message but never use it. Instead we should log the message where the error happened. For cases where we want to return a message it would be better to have a Result<TValue, TErrorEnum> where TErrorEnum must be a enum describing the type of error. For that type a message might make more sense. For simple cases check if the old if (!TryParse("test", out Guid? id)) makes more sense

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions