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 new System.ComponentModel.DataAnnotations features #82311

Merged

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented Feb 17, 2023

Fix #77402. Each attribute has been segregated into a separate commit for easier reviewing.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned eiriktsarpalis Feb 17, 2023
@ghost
Copy link

ghost commented Feb 17, 2023

Tagging subscribers to this area: @ajcvickers, @bricelam, @roji
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #77402.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.ComponentModel.DataAnnotations, new-api-needs-documentation

Milestone: -

@eiriktsarpalis eiriktsarpalis marked this pull request as ready for review February 21, 2023 16:51
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Feb 21, 2023
@eiriktsarpalis
Copy link
Member Author

eiriktsarpalis commented Feb 21, 2023

All new attributes have now been implemented -- marking ready for review. Each attribute has been segregated into a separate commit for easier reviewing.

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

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

I replied to a couple of resolved comments just in case you didn't see it. LGTM, otherwise.

@eiriktsarpalis eiriktsarpalis merged commit 07f5fca into dotnet:main Feb 23, 2023
@eiriktsarpalis eiriktsarpalis deleted the feature/new-data-annotations branch February 23, 2023 18:59
foreach (object? allowed in Values)
{
if (allowed is null ? value is null : allowed.Equals(value))
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Shouldn't the variable name be disallowed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good point. Would you be interested in contributing a fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

How? I'm newbie here. Don't know the best approach. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that the change is fairly simple, you might be able to send a PR directly from the browser. Open up

https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/DeniedValuesAttribute.cs

And hit the edit button:

image

Make the change and follow the instructions to submit a PR. Done :-)

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Thanks for getting this in place for Preview 2, @eiriktsarpalis! Looks good!

@jeffhandley jeffhandley added the blog-candidate Completed PRs that are candidate topics for blog post coverage label Mar 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.ComponentModel.DataAnnotations blog-candidate Completed PRs that are candidate topics for blog post coverage new-api-needs-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Expand data validation attributes
7 participants