UriTemplate.BindByName Method (Uri, IDictionary<String, String>)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a new URI from the template and the collection of parameters.

Namespace:   System
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public Uri BindByName(
	Uri baseAddress,
	IDictionary<string, string> parameters


Type: System.Uri

The base address.

Type: System.Collections.Generic.IDictionary<String, String>

A dictionary that contains a collection of parameter name/value pairs.

Return Value

Type: System.Uri


The T:System.Collections.Generic.IDictionary{System.String,System.String} parameter contains a collection of parameter name and value pairs. The parameters are matched up against the variables within the template by a case-insensitive comparison.


The name/value collection passed to this method must contain a key for every template variable. Extra name/value pairs that do not match template variables are appended to the query string of the final URI.

System_CAPS_security Security Note

It is possible to pass in text within the name/value pairs that prevent the generated URI from matching the template that is used to generate it. Examples of such text includes: '/', '..', '*', '{', and '}'.

.NET Framework
Available since 3.5
Available since 4.0
Return to top