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
Create a new attribute for Pages property binding #6091
Comments
Open question here - should we support this attribute on controllers? Should we add support for If we do these things there's no issue with needing to hide this attribute, it can go in the root MVC namespace. |
@danroth27 RE the putting this on Controllers question. I don't have an issue with it, given it seems so explicit, seems like we'd need a good reason not to support it. |
I agree. One of our goals is not to introduce new pages only primitives. |
For preview 1 we're adding this for Pages only and it will be in the |
rynowak
added a commit
that referenced
this issue
Apr 21, 2017
rynowak
added a commit
that referenced
this issue
Apr 21, 2017
rynowak
added a commit
that referenced
this issue
Apr 21, 2017
rynowak
added a commit
that referenced
this issue
Apr 22, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We want to create a new attribute
[BindProperty]
which means that the property should be model bound.We'll have an override via a property
bool SupportsGet
which enables binding of the properties for GET requests.Placing the attribute on a class means that it applies to all public properties in the class. This has overriding behavior - the attribute on the property wins. There is no way to un-bind a property if you use the attribute at the class level.
This new attribute should go in the RazorPages namespace. Features like
SupportsGet
aren't relevant to controllers.Examples:
The text was updated successfully, but these errors were encountered: