Skip to content

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

Closed
wants to merge 11 commits into from
Closed

Explicit parameter binding #1009

wants to merge 11 commits into from

Conversation

KathleenDollard
Copy link
Contributor

Allows differently named parameters and paired options/arguments

@KathleenDollard
Copy link
Contributor Author

Fixes #952

Comment on lines 213 to 217
if (parameterDescriptor.HasDefaultValue)
boundValue = BoundValue.DefaultForValueDescriptor(parameterDescriptor);
else if (parameterDescriptor.AllowsNull &&
else if (parameterDescriptor.AllowsNull &&
ShouldPassNullToConstructor(constructorDescriptor.Parent, constructorDescriptor))
boundValue = BoundValue.DefaultForType(valueDescriptor);
Copy link
Contributor

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");
Copy link
Contributor

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?

@KathleenDollard
Copy link
Contributor Author

Replaced with #1018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants