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

Use NullabilityInfoContext in DataAnnotationsMetadataProvider #39219

Merged

Conversation

captainsafia
Copy link
Member

Closes #38774.

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Dec 28, 2021
@captainsafia captainsafia force-pushed the safia/nullable-context-provider branch from 15ed8a0 to 2063212 Compare December 29, 2021 17:19
Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

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

Looks great

Comment on lines 27 to 28
private const string NullableAttributeFullTypeName = "System.Runtime.CompilerServices.NullableAttribute";
private const string NullableFlagsFieldName = "NullableFlags";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this also be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still used in this method (ref) which is used here where we don't have access to the PropertyInfo and only the attributes on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say it might be ok to remove that code now. We'll have enough time in this release to know if we break someone (super unlikely)

@captainsafia captainsafia marked this pull request as ready for review January 3, 2022 20:57
@captainsafia captainsafia requested a review from javiercn as a code owner January 3, 2022 20:57
Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider updating DataAnnotationsMetadataProvider to use NullabilityInfoContext
2 participants