-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
/cc @pranavkm - this is for you |
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.
Is this what the behavior is now:
BindProperty
-> Does not bind on GETs by default.
FromRoute
(or any other model binding attribute) -> Binds on GETs.
{ | ||
get | ||
{ | ||
return SupportsGet ? (ActionContext c) => true : (Func<ActionContext, bool>)IsNonGetRequest; |
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.
Cache the delegates as statics?
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.
sure
foreach (var requestPredicateProvider in attributes.OfType<IRequestPredicateProvider>()) | ||
{ | ||
isBindingInfoPresent = true; | ||
bindingInfo.RequestPredicate = requestPredicateProvider.RequestPredicate; |
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.
Should this break
after the first item (similar to BindingSource
)? It's picking predicate arbitrarily anyway
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.
hmm maybe
{ | ||
/// <summary> | ||
/// An interface that allows a top-level model to be bound or not bound based on state assocated | ||
/// with the current request. |
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.
current ActionContext
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.
No, I mean the concept of a current request.
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.
Also associated
Yes. Pages and controllers now both behave as you described above. |
9036165
to
0ad9c7d
Compare
This changeset reckonciles the binding work we did for pages with
controllers.
A quick summary: