ardalis / Result

A result abstraction that can be mapped to HTTP response codes if needed.
MIT License
866 stars 107 forks source link

Add support for single validation error with Result.Invalid #144

Closed IliyanAng closed 1 year ago

IliyanAng commented 1 year ago

More often than not I find myself passing a single Validation error in the Result.Invalid method. This PR addresses that. I do believe this to be a needed improvement, as it's very annoying to create new Lists only to pass a single object in them.

ardalis commented 1 year ago

Love it and agree, thanks!

github-actions[bot] commented 1 year ago

Code Coverage

Package Line Rate Branch Rate Complexity Health
Ardalis.Result.FluentValidation 86% 50% 6
Ardalis.Result.Sample.Core 18% 18% 63
Ardalis.Result 23% 7% 73
Summary 24% (93 / 387) 19% (10 / 54) 142