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

[Required] Used to get generated and be super helpful with MVC validation #27962

Closed
OpenSpacesAndPlaces opened this issue May 6, 2022 · 2 comments

Comments

@OpenSpacesAndPlaces
Copy link

[Required] Used to get generated and be super helpful with MVC validation. e.g. EF would scaffold the model with [Required]. Now it just does nullable ? fields. But this doesn't see to play nice with ModelState.IsValid anymore and you don't get warnings about missing fields.

ModelState.IsValid supports nullable ? fields or [Required] is brought back.

Any help appreciated. Thanks!

.Net Core 6.

@roji
Copy link
Member

roji commented May 6, 2022

This would probably be enabled via scaffolding templates (#4038).

@OpenSpacesAndPlaces
Copy link
Author

Worked around this with "TryValidateModel" being explicitly called

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
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

3 participants