You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, it's possible to use the validation result only if you use the ErrorOr overload:
var result = FilePath.TryFrom("X:/test");
if (!result.IsSuccess)
{
Console.Out.WriteLine("Validation error occurred: {0}", result.Error.ErrorMessage);
}
An overload could be added so the boolean version of TryFrom also returns the validation result - as an out parameter:
if (!FilePath.TryFrom("X:/test", out var filePath, out var validationResult))
{
Console.Out.WriteLine("Validation error occurred: {0}", validationResult.ErrorMessage);
}
I find the latter to be a lot more convenient to write. I am new to this repository, please let me know if this does not align with the vision or might not be a good idea for certain reasons. I can contribute.
Thank you!
The text was updated successfully, but these errors were encountered:
Describe the feature
Currently, it's possible to use the validation result only if you use the ErrorOr overload:
An overload could be added so the boolean version of
TryFrom
also returns the validation result - as anout
parameter:I find the latter to be a lot more convenient to write. I am new to this repository, please let me know if this does not align with the vision or might not be a good idea for certain reasons. I can contribute.
Thank you!
The text was updated successfully, but these errors were encountered: