-
Notifications
You must be signed in to change notification settings - Fork 10k
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 nullability to Identity / Identity.UI #40167
Conversation
e0be3b8
to
60310df
Compare
@@ -36,7 +36,7 @@ public SecurityStampValidator(IOptions<SecurityStampValidatorOptions> options, S | |||
SignInManager = signInManager; | |||
Options = options.Value; | |||
Clock = clock; | |||
Logger = logger.CreateLogger(this.GetType().FullName); | |||
Logger = logger.CreateLogger(GetType()); |
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.
Slight functional change.
@@ -27,26 +27,26 @@ public class ExternalLoginModel : PageModel | |||
/// directly from your code. This API may change or be removed in future releases. | |||
/// </summary> | |||
[BindProperty] | |||
public InputModel Input { get; set; } | |||
public InputModel Input { get; set; } = default!; |
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.
I mentioned this to @DamianEdwards - the Input
property is only bound in OnPost
and it would make more sense to mark this as nullable. However this has two annoying issues:
a) ModelExpression - which is what you get if you do <input asp-for"Input.Name" />
is a expression tree which does not support using null propagation. MVC handles null-values in the expression tree, but as a user you're forced to use a null-forgiveness operator which doesn't feel nice: <input asp-for"Input!.Name" />
b) You end up having to also assert that this value is non-null in every OnPost
.
Making it non-nullable seems like a cheeky but less painful way to go about this.
No description provided.