This library provides simple extension methods for converting Validated results into Flow results, making it easier to integrate validation outcomes with flow returns.
Add the Flow.Validated nuget package to your project using Nuget Package Manager or the dotnet CLI:
dotnet add package Flow.Validated
Add the using statement using Validated.Core.Extensions.
to access the ToFlow<T>
extension.
Currently there is a single ToFlow<T>
extension method with an async overload that attaches to a Validated<T>
returning a Flow<T>
If the Validated<T>
is invalid it creates a failed Flow<T>
using the Failure.InvalidEntryFailure
type, copying the list of InvalidEntry
into the failure.
Note: If any of the invalid entries have a Cause that is not set to Validation, such as SystemError or RuleConfigError then the CanRetry property is set to false otherwise it is set to true