RouteOptions.SetParameterPolicy Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SetParameterPolicy(String, Type) |
Adds or overwrites the parameter policy with the associated route pattern token. |
SetParameterPolicy<T>(String) |
Adds or overwrites the parameter policy with the associated route pattern token. |
SetParameterPolicy(String, Type)
- Source:
- RouteOptions.cs
Adds or overwrites the parameter policy with the associated route pattern token.
public void SetParameterPolicy (string token, Type type);
member this.SetParameterPolicy : string * Type -> unit
Public Sub SetParameterPolicy (token As String, type As Type)
Parameters
- token
- String
The route token used to apply the parameter policy.
- type
- Type
The parameter policy type.
Exceptions
Throws an exception if the type is not an IParameterPolicy.
Applies to
SetParameterPolicy<T>(String)
- Source:
- RouteOptions.cs
Adds or overwrites the parameter policy with the associated route pattern token.
public void SetParameterPolicy<T> (string token) where T : Microsoft.AspNetCore.Routing.IParameterPolicy;
member this.SetParameterPolicy : string -> unit (requires 'T :> Microsoft.AspNetCore.Routing.IParameterPolicy)
Public Sub SetParameterPolicy(Of T As IParameterPolicy) (token As String)
Type Parameters
- T
The parameter policy type.
Parameters
- token
- String
The route token used to apply the parameter policy.