-
Notifications
You must be signed in to change notification settings - Fork 402
Explicit parameter binding #1009
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
Explicit parameter binding #1009
Conversation
Fixes #952 |
if (parameterDescriptor.HasDefaultValue) | ||
boundValue = BoundValue.DefaultForValueDescriptor(parameterDescriptor); | ||
else if (parameterDescriptor.AllowsNull && | ||
else if (parameterDescriptor.AllowsNull && | ||
ShouldPassNullToConstructor(constructorDescriptor.Parent, constructorDescriptor)) | ||
boundValue = BoundValue.DefaultForType(valueDescriptor); |
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.
It looks like this block should also be part of the extracted GetBoundValue
method.
// check for nulls | ||
if (!(handler is ModelBindingCommandHandler bindingHandler)) | ||
{ | ||
throw new InvalidOperationException("Cannot bind to this type of handler"); |
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.
Maybe we should just make ModelBindingCommandHandler
public?
Replaced with #1018 |
Allows differently named parameters and paired options/arguments