* Added ControllerFeature and ControllerFeatureProvider to perform controller discovery.
* Changed controller discovery to use application parts.
* Changed ControllerActionDescriptorProvider to make use of Application parts.
* Simplified AddControllerAsServices to not accept any parameter and perform
controller discovery through the ApplicationPartManager in the IMvcBuilder
and IMvcCoreBuilder. Assemblies should be added to the ApplicationPartManager
in order to discover controllers in them.
This change renames IPropertyBindingPredicateProvider to
IPropertyFilterProvider. The changes here are mostly renames of
parameters/variables from predicate -> propertyFilter. I did a
find+replace and left the term 'predicate' in some of the docs because it
refers to a predicate in the abstract sense.
This change also simplifies BindAttribute and removes support for type
activation.
This commit introduces application parts as a concept on MVC.
An application part is an abstraction that allows you to expose some
feature or corncern in a way that is decoupled from their underlying source.
Examples of this include types in an assembly, emdeded resources, files on
disk etc.
Application parts are configured during startup by adding or removing them from
the application part manager available as part of IMvcBuilder and IMvcCoreBuilder.
The application part manager provides the ability to populate features from the
list of available application parts by using a list of application feature providers.
Application feature providers are responsible for populating a given feature given a
list of application parts.
Examples of application providers can be a ControllerFeatureProvider
that goes through the list of application parts, sees which one of those parts exposes types,
determines which of those types are controller types, and adds them to a ControllerFeature
that holds a list of all the types that will be considered controllers in the application.
* Introduce ControllerAttribute and use it to mark base classes as controllers.
* Changed rules for controller discovery to:
* All controller types must be public, concrete, non open generic types.
* NotController attribute is not applied to any type oif the hierarchy.
* The type name ends with controller.
* Controller attribute is applied to the type or to one of its ancestors.
* Moved instantiation of tag helpers into DefaultTagHelperActivator.
* Introduced ITagHelperFactory for handling the setup of new tag helper instances.
Just a safety measure in case anything evades our 'flattening'. I don't
have any evidence that we're failing to clear something, but we want this
here as a safeguard.
use authorization policies and requirements(IAuthorizationRequirement) to enforce authorization.
[Fixes#4233] AuthorizationFilterAttribute returns UnauthorizedResult rather than ChallengeResult
This change no longer suppresses validation for IFormFile and
IFormFileCollection model values. This will allow the use of [Required] on an
IFormFile model, or a custom attribute for validating IFormFileCollection.
These types already have ValidateChildren = false, so we don't recurse
into them.
This change separates model binding into IModelBinderProvider (decides
which binder to use) and IModelBinder (does binding). The
IModelBinderFactory is a new services with coordinates the creation of
model binders.
Removes all of the ModelBinding configuration support from Resource
Filters. We haven't come up with concrete scenarios around these features,
and don't want to paint ourselves into a corner with extensibility.
- Introducing a new distributed cache tag helper
- Sharing base implementation for both cache tag helper
- Preventing concurrent execution of cache tag helpers
Fixes#4147 , Fixes#3867