This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Properties marked with [FromHeader]
attribute do not use default values when a header is not present
#1722
Comments
How does this work for other model binders when the value does not exist? |
Other model binders aren't greedy and don't |
The suggestion is to fix this by changing the context to have another flag that indicates if a value was produced. This flag will be set to |
We also want to consider as part of this change moving default value setting to a single location (where now it is spread between |
rynowak
added a commit
that referenced
this issue
Jan 16, 2015
This change adds support for our three-valued logic to the default value handling part of the MutableObjectModelBinder. The issue is that we want to look up a default value when a 'greedy' model binder returns true but doesn't find a value. We also don't want to call the property setter unless there is: 1). A value from model binding OR 2). A default value
rynowak
added a commit
that referenced
this issue
Jan 16, 2015
This change adds support for our three-valued logic to the default value handling part of the MutableObjectModelBinder. The issue is that we want to look up a default value when a 'greedy' model binder returns true but doesn't find a value. We also don't want to call the property setter unless there is: 1). A value from model binding OR 2). A default value
rynowak
added a commit
that referenced
this issue
Jan 16, 2015
This change adds support for our three-valued logic to the default value handling part of the MutableObjectModelBinder. The issue is that we want to look up a default value when a 'greedy' model binder returns true but doesn't find a value. We also don't want to call the property setter unless there is: 1). A value from model binding OR 2). A default value
rynowak
added a commit
that referenced
this issue
Jan 16, 2015
This change adds support for our three-valued logic to the default value handling part of the MutableObjectModelBinder. The issue is that we want to look up a default value when a 'greedy' model binder returns true but doesn't find a value. We also don't want to call the property setter unless there is: 1). A value from model binding OR 2). A default value
rynowak
added a commit
that referenced
this issue
Jan 17, 2015
This change adds support for our three-valued logic to the default value handling part of the MutableObjectModelBinder. The issue is that we want to look up a default value when a 'greedy' model binder returns true but doesn't find a value. We also don't want to call the property setter unless there is: 1). A value from model binding OR 2). A default value
1e7812e7e0e5fc2e4e0d726f5903f9a8259c254 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Consider:
TestModelBoundValue
picks up the default value when a value for the property is not found.TestHeader
stays null when the a header is absent.The text was updated successfully, but these errors were encountered: