ardalis / ardalis/Result

Add a static Error method in Result<T> and Result classes that accepts an Error object

Open
#223 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

It would be helpful to have an `Error` class similar to the existing `ValidationError` class, which can be used to encapsulate error details. Something like this:
```
public class Error
{
public string Message { get; set; }
public string Code { get; set; }
}
```
Additionally, it would be great to add a static Error method in both the `Result` and `Result` classes that accepts an Error object.

Contributor guide

Open the contributing guide

Research direction

Start by examining the existing ValidationError class and the Result and Result classes to understand their current error representation and static factory methods. Define the requested Error object and add the corresponding static methods in both result classes; done means each class accepts an Error object while preserving existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.