Skip to content

Instantly share code, notes, and snippets.

@jechtom
Created February 20, 2015 11:49
Show Gist options
  • Save jechtom/d60071a26462f7f8a4bc to your computer and use it in GitHub Desktop.
Save jechtom/d60071a26462f7f8a4bc to your computer and use it in GitHub Desktop.
foreach (var dataContract in contracts)
{
var result = dataContract.Validate();
if (result.IsValid)
return;
// disable logging for this kind of exception (its validation error)
var ex = result.ToException(ErrorCodes.InvalidRequest);
MarkAsValidationError(ex);
throw ex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment