From bd91f89ce90d76d9441852920b078473cb212107 Mon Sep 17 00:00:00 2001 From: David Ferneding Date: Thu, 14 Nov 2024 13:51:15 +0100 Subject: [PATCH] chore: add ToErrorOrAsync to readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 2b79411..539e3e0 100644 --- a/README.md +++ b/README.md @@ -296,8 +296,16 @@ public ErrorOr MultipleErrorsToErrorOr() ## Using The `ToErrorOr` Extension Method +### Values + ```cs ErrorOr result = 5.ToErrorOr(); +ErrorOr result = await Task.FromResult(5).ToErrorOrAsync(); +``` + +### Errors + +```cs ErrorOr result = Error.Unexpected().ToErrorOr(); ErrorOr result = new[] { Error.Validation(), Error.Validation() }.ToErrorOr(); ```