-
Notifications
You must be signed in to change notification settings - Fork 203
Ensure @model types have a mapping in razor pages #11844
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
Conversation
@dotnet/razor-compiler For reviews please :) |
Can you please rename the PR for clarity? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tooling LGTM
#nullable restore | ||
public TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives Model => ViewData.Model!; | ||
#nullable disable | ||
public TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives Model => ViewData.Model; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks suspicious. Previously the Model
property here was nullable-enabled, now it's nullable-disabled, isn't that a regression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Model property in this case isn't coming from the user, if you look it's the type of name of the file which is generated code, declared outside of the users nullability annotations. So, it's correct that it shouldn't be nullable annotated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Ensure we write out the mapping for
@model
types in razor pages.Commit by commit should hopefully make the fix pretty self-explanatory.
Fixes: #11329