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

add post about corvus.jsonschema #6

Merged
merged 3 commits into from
Feb 11, 2024
Merged

add post about corvus.jsonschema #6

merged 3 commits into from
Feb 11, 2024

Conversation

gregsdennis
Copy link
Collaborator

No description provided.


```c#
if (value < 0)
throw new ArgumentException(nameof(value), "Value must be greater than 0");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not actually true - you can set the value but then the result won't be IsValid() == true any more. We avoid exceptions wherever possible because they are so expensive.

But the setters are strongly typed (including taking into account e.g. format.

Copy link
Collaborator Author

@gregsdennis gregsdennis Feb 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I didn't realize that.

Looking at some docs, it seems that it will take any (typed) value, and then validation is performed in the .IsValid() method, as you mentioned.

Alright. I'll update that. (I thought the model was enforced to be valid.)

@gregsdennis gregsdennis merged commit 0b5495d into main Feb 11, 2024
1 check passed
@gregsdennis gregsdennis deleted the corvus branch February 11, 2024 21:36
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 this pull request may close these issues.

2 participants