Edit

Share via


UriTemplate Constructors

Definition

Initializes a new instance of the UriTemplate class.

Overloads

UriTemplate(String)

Initializes a new instance of the UriTemplate class with the specified template string.

UriTemplate(String, Boolean)

Initializes a new instance of the UriTemplate class.

UriTemplate(String, IDictionary<String,String>)

Initializes a new instance of the UriTemplate class.

UriTemplate(String, Boolean, IDictionary<String,String>)

Initializes a new instance of the UriTemplate class.

UriTemplate(String)

Initializes a new instance of the UriTemplate class with the specified template string.

public:
 UriTemplate(System::String ^ template);
public UriTemplate (string template);
new UriTemplate : string -> UriTemplate
Public Sub New (template As String)

Parameters

template
String

The template.

Examples

The following example shows how to call the constructor.

UriTemplate template = new UriTemplate("weather/{state}/{city}?forecast={day}");
Dim template As UriTemplate = New UriTemplate("weather/{state}/{city}?forecast={day}")

Applies to

UriTemplate(String, Boolean)

Initializes a new instance of the UriTemplate class.

public:
 UriTemplate(System::String ^ template, bool ignoreTrailingSlash);
public UriTemplate (string template, bool ignoreTrailingSlash);
new UriTemplate : string * bool -> UriTemplate
Public Sub New (template As String, ignoreTrailingSlash As Boolean)

Parameters

template
String

The template string.

ignoreTrailingSlash
Boolean

A value that specifies whether trailing slash "/" characters should be ignored.

Remarks

When the ignoreTrailingSlash is set to true, trailing slashes on the end of template are ignored when matching a candidate URI. For example, a template such as http://www.microsoft.com/customer/ would match the following candidate URIs:

  • http://www.microsoft.com/customer/
  • http://www.microsoft.com/customer
  • http://www.microsoft.com/customer/?wsdl
  • http://www.microsoft.com/customer?wsdl

Applies to

UriTemplate(String, IDictionary<String,String>)

Initializes a new instance of the UriTemplate class.

public:
 UriTemplate(System::String ^ template, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ additionalDefaults);
public UriTemplate (string template, System.Collections.Generic.IDictionary<string,string> additionalDefaults);
new UriTemplate : string * System.Collections.Generic.IDictionary<string, string> -> UriTemplate
Public Sub New (template As String, additionalDefaults As IDictionary(Of String, String))

Parameters

template
String

The template string.

additionalDefaults
IDictionary<String,String>

A dictionary that contains a list of default values for the template parameters.

Applies to

UriTemplate(String, Boolean, IDictionary<String,String>)

Initializes a new instance of the UriTemplate class.

public:
 UriTemplate(System::String ^ template, bool ignoreTrailingSlash, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ additionalDefaults);
public UriTemplate (string template, bool ignoreTrailingSlash, System.Collections.Generic.IDictionary<string,string> additionalDefaults);
new UriTemplate : string * bool * System.Collections.Generic.IDictionary<string, string> -> UriTemplate
Public Sub New (template As String, ignoreTrailingSlash As Boolean, additionalDefaults As IDictionary(Of String, String))

Parameters

template
String

The template string.

ignoreTrailingSlash
Boolean

true if the trailing slash "/" characters are ignored; otherwise false.

additionalDefaults
IDictionary<String,String>

A dictionary that contains a list of default values for the template parameters.

Applies to