Skip to content

ParseResult.IsValid is re-evaluated for each call #58

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

Closed
akamsteeg opened this issue Sep 18, 2019 · 0 comments
Closed

ParseResult.IsValid is re-evaluated for each call #58

akamsteeg opened this issue Sep 18, 2019 · 0 comments
Assignees
Milestone

Comments

@akamsteeg
Copy link
Owner

akamsteeg commented Sep 18, 2019

In ParseResult.IsValid, the result is evaluated again for each call:

public bool IsValid
{
get
{
var result = !ValidationErrors.Any();
return result;
}
}

However, it will always be the same.

Suggestion: Change this to a readonly property and set the value in the constructor.

@akamsteeg akamsteeg added this to the 3.0.0 milestone Sep 18, 2019
@akamsteeg akamsteeg self-assigned this Sep 18, 2019
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