Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic changed between depricated Guard.Against.AgainstExpression(...) and new Guard.Against.Expression(...) #356

Closed
egreiner opened this issue Sep 30, 2024 · 1 comment · Fixed by #357

Comments

@egreiner
Copy link
Contributor

Logic inverted between
GuardAgainstExpression.cs
and
GuardAgainstExpressionDeprecated.cs

before it was:
if (!func(input)) throw
now it's:
if (func(input)) throw

in tests:
before it was :
"Value is not equal to 10"
now it's:
"Value cannot be 10"

should imho be mentioned in
[Obsolete("Deprecated: Switch to Expression for validation.")]

  • .NET SDK Version:
    all

Steps to Reproduce:

  1. look at the tests for GuardAgainstExpression and GuardAgainstExpressionDeprecated
@ardalis
Copy link
Owner

ardalis commented Sep 30, 2024

Good point. I'll update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants