UriTemplate.IsEquivalentTo(UriTemplate) Method

Definition

Indicates whether a UriTemplate is structurally equivalent to another.

C#
public bool IsEquivalentTo(UriTemplate other);

Parameters

other
UriTemplate

The UriTemplate to compare.

Returns

true if the UriTemplate is structurally equivalent to another; otherwise false.

Examples

The following example shows how to call the IsEquivalentTo(UriTemplate).

C#
UriTemplate template = new UriTemplate("weather/{state}/{city}?forecast={day}");
UriTemplate template2 = new UriTemplate("weather/{country}/{village}?forecast={type}");

bool equiv = template.IsEquivalentTo(template2);

Remarks

Two UriTemplate instances are equivalent if their literal strings are identical and the variables appear in the same segments. For example "weather/{state}/{city}" is equivalent to "weather/{country}/{village}".

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1