Skip to content

Instantly share code, notes, and snippets.

@jrob5756
Last active September 12, 2018 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrob5756/81b7e42fd0b7214944c79b4f0ad80658 to your computer and use it in GitHub Desktop.
Save jrob5756/81b7e42fd0b7214944c79b4f0ad80658 to your computer and use it in GitHub Desktop.
public class InputProcessor
{
private readonly IEnumerable<IValidator> _validators;
public InputProcessor(IEnumerable<IValidator> validators)
{
_validators = validators;
}
public void Process(string input)
{
foreach (var validator in _validators)
{
var result = validator.Validate(input);
if (result.IsValid == false)
{
// Removed for brevity
}
}
// Removed for brevity
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment