-
-
Notifications
You must be signed in to change notification settings - Fork 284
Closed
Labels
.NETPull requests that update .net codePull requests that update .net codebuggood first issuehelp wanted
Description
Currently when using the expression guard you have to write code like this:
Guard.Against.AgainstExpression(x => false, input, "error");which obviously has "Against" in it twice and comes across as a double negative. It's also not clear (to me at least without reading the docs/ viewing the source) whether the expression should describe the "happy path" or the "invalid path". It would be more clear if I knew I was guarding against something I did not want, and then the expression would describe the INVALID state.
How to Implement:
- Mark
AgainstExpressionas obsolete. - Create
Expressionor name similar if we can't use that name and have it do the same thing. - Consider using CallerArgumentExpression in the parameter list if that makes sense.
- Make sure it's super clear that the expression should be the negative, invalid case. When it's true, that means the input is BAD, and an exception will be thrown.
After we publish the two side-by-side I will remove the obsolete one in a future version.
Metadata
Metadata
Assignees
Labels
.NETPull requests that update .net codePull requests that update .net codebuggood first issuehelp wanted