Class ParameterBindingRulesCollection
- Namespace
- System.Web.Http.ModelBinding
- Assembly
- System.Web.Http.dll
Collection of functions that can produce a parameter binding for a given parameter.
public class ParameterBindingRulesCollection : Collection<Func<HttpParameterDescriptor, HttpParameterBinding>>, IList<Func<HttpParameterDescriptor, HttpParameterBinding>>, ICollection<Func<HttpParameterDescriptor, HttpParameterBinding>>, IList, ICollection, IReadOnlyList<Func<HttpParameterDescriptor, HttpParameterBinding>>, IReadOnlyCollection<Func<HttpParameterDescriptor, HttpParameterBinding>>, IEnumerable<Func<HttpParameterDescriptor, HttpParameterBinding>>, IEnumerable
- Inheritance
-
ParameterBindingRulesCollection
- Implements
- Inherited Members
Constructors
ParameterBindingRulesCollection()
Initializes a new instance of the ParameterBindingRulesCollection class.
public ParameterBindingRulesCollection()
Methods
Add(Type, Func<HttpParameterDescriptor, HttpParameterBinding>)
Adds function to the end of the collection. The function added is a wrapper around funcInner that checks that parameterType matches typeMatch.
public void Add(Type typeMatch, Func<HttpParameterDescriptor, HttpParameterBinding> funcInner)
Parameters
typeMatch
Typetype to match against HttpParameterDescriptor.ParameterType
funcInner
Func<HttpParameterDescriptor, HttpParameterBinding>inner function that is invoked if type match succeeds
Insert(int, Type, Func<HttpParameterDescriptor, HttpParameterBinding>)
Insert a function at the specified index in the collection. /// The function added is a wrapper around funcInner that checks that parameterType matches typeMatch.
public void Insert(int index, Type typeMatch, Func<HttpParameterDescriptor, HttpParameterBinding> funcInner)
Parameters
index
intindex to insert at.
typeMatch
Typetype to match against HttpParameterDescriptor.ParameterType
funcInner
Func<HttpParameterDescriptor, HttpParameterBinding>inner function that is invoked if type match succeeds
LookupBinding(HttpParameterDescriptor)
Execute each binding function in order until one of them returns a non-null binding.
public HttpParameterBinding LookupBinding(HttpParameterDescriptor parameter)
Parameters
parameter
HttpParameterDescriptorparameter to bind.
Returns
- HttpParameterBinding
the first non-null binding produced for the parameter. Of null if no binding is produced.