Scharps / Scharps.Either

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scharps.Either

Either is a light result library to distinguish between errors and successful results without the use of exceptions.

Usage

Result<Error> failedResult = CouldFail();
Result<Error, string> successfulResult = SuccessfulResult();

if (successfulResult.Value is string s)
{
    System.Console.WriteLine(s);
}
else if (successfulResult.Error is IError e)
{
    System.Console.WriteLine(e.Message);
}

About

License:MIT License


Languages

Language:C# 100.0%