RouteConstraintBuilder.AddConstraint(String, Object) 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.
Adds a constraint instance for the given key.
public:
void AddConstraint(System::String ^ key, System::Object ^ value);
public void AddConstraint (string key, object value);
member this.AddConstraint : string * obj -> unit
Public Sub AddConstraint (key As String, value As Object)
Parameters
- key
- String
The key.
- value
- Object
The constraint instance. Must either be a string or an instance of IRouteConstraint.
Remarks
If the value
is a string, it will be converted to a RegexRouteConstraint.
For example, the string Product[0-9]+
will be converted to the regular expression ^(Product[0-9]+)
. See Regex for more details.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for