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

Logical error in code? #506

Open
torkuen opened this issue Jan 11, 2025 · 0 comments
Open

Logical error in code? #506

torkuen opened this issue Jan 11, 2025 · 0 comments

Comments

@torkuen
Copy link

torkuen commented Jan 11, 2025

Type of issue

Other (describe below)

Description

[Enter feedback here]
Logical error:

if CompareTo result is not >0 it may be Zero as well, which is not reflected in the result message (should be "equal or smaller").

if (((IComparable)value).CompareTo(otherValue) > 0)
{
return ValidationResult.Success;
}

    return new("The current value is smaller than the other one");

Page URL

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/observablevalidator

Content source URL

https://github.com/MicrosoftDocs/CommunityToolkit/blob/main/docs/mvvm/ObservableValidator.md

Document Version Independent Id

0b0d4bb1-f1a9-4fa9-af90-e5d30b436701

Article author

@Sergio0694

Metadata

  • ID: 0b0d4bb1-f1a9-4fa9-af90-e5d30b436701
  • Service: dotnet-communitytoolkit
  • Sub-service: mvvm-toolkit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant