The state of validation in C# leaves something to be desired. Recently I was writing some code in the same old classic styles and the frustration got to me - surely there must be a better approach that doesn’t involve great lists of strings, the use of exceptions for flow control, and brittle unit tests.
Saturday, July 14 2018 visual-studio
In an earlier post, I detailed how I converted a personal project across to the new csproj file format - it turns out that I made a few mistakes in the process.
To recap from last time, we want to create a simple library that allows us to express validation in a straightforward way, allowing us to concentrate on the rules we’re checking, not the boilerplate needed to make it work.
As alluded in the prior post, all of our return types so far have been
ValidationResult - but our consumers will need to know whether they have a success or an error in order to make decisions.