IActionConstraint follows a provider model similar to filters. The
attributes that go on actions/controllers can be simple metadata markers,
the 'real' constraint is provided by a set of configurable providers. In
general the simplest thing to do is to be both an
IActionConstraintMetadata and IActionConstraint, and then the default
provider will take care of you.
IActionConstraint now has stages based on the Order property. Each group
of constraints with the same Order will run together on the set of
actions. This process is repeated for each value of Order until we run out
of actions or run out of constraints.
The IActionConstraint interface is beefier than the equivalent in legacy
MVC. This is to support cooperative coding between sets of constraints
that know about each other. See the changes in the sample, which implement
webapi-style overloading.
- only affects an extreme corner case: user sets `metadata.EditFormatString` then reads
`metadata.DisplayFormatString`
- an extreme case because `EditFormatString` is normally set only when
`DisplayFormatString` is set and, if set, it's to the same value
- happened to see this while updating `CachedDataAnnotationsModelMetadata` for this PR
nit: an -> a in an adjacent XML comment in `CachedDataAnnotationsModelMetadata`
1) Implemented FilePathResult to efficiently return files from disk.
2) Implemented FileStreamResult to return content from a stream.
3) Implemented FileContentResult to return content from a byte array.
This change removes WebAPI-style method parameter overloading and the
automatic mapping of 'unnamed' actions based on method names. For all
practicaly purposes, this change restores the MVC5 behavior for action
selection.
WebAPI-style overloading will be brought back in the future via a set of
opt-in constructs.
This adds support for attributes which interact with reflected model.
These conventions are applied after all of our built-in constructs so that
you can see and modify the results.
to precompile razor pages.
This is limited to sites where the .cshtml are still deployed. It's
current purpose is to speed up startup. Deploying without the razor
files is a separate feature.
1. Support multiple [Http*] attributes on an action.
2. Support multiple [Route] attributes on a controller and on an action.
3. Support creating multiple attribute routes using [AcceptVerbs("...", Route = "...")]
4. Detect attribute routed actions during action discovery and return one action per [Http*],
[Route] or [AcceptVerbs] attribute found on the method when there is at least one valid attribute route.
5. Merge all the HTTP methods of [Http*] and [AcceptVerbs] attributes in a method during
action discovery when there are no valid attribute routes defined on the action.
6. Build one action descriptor per controller [Route] + action [Http*], [AcceptVerbs]
or [Route] combination in an action.
7. Disallow the use of attributes that do not implement IActionHttpMethodProvider and
IRouteTemplateProvider simultaneously in methods that define attribute routed
actions and throw an exception during startup.
8. Disallow mixing attribute routed and non attribute routed actions on the same method
and throw an exception during startup.