UriTemplate.IsEquivalentTo(UriTemplate) Metoda

Definicja

Wskazuje, czy element UriTemplate jest strukturalnie równoważny innemu.

public:
 bool IsEquivalentTo(UriTemplate ^ other);
public bool IsEquivalentTo (UriTemplate other);
member this.IsEquivalentTo : UriTemplate -> bool
Public Function IsEquivalentTo (other As UriTemplate) As Boolean

Parametry

other
UriTemplate

Element UriTemplate do porównania.

Zwraca

Boolean

true jeśli element UriTemplate jest strukturalnie równoważny innemu, w przeciwnym razie false.

Przykłady

W poniższym przykładzie pokazano, jak wywołać metodę IsEquivalentTo(UriTemplate).

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

bool equiv = template.IsEquivalentTo(template2);
Dim template As UriTemplate = New UriTemplate("weather/{state}/{city}?forecast={day}")
Dim template2 As UriTemplate = New UriTemplate("weather/{country}/{village}?forecast={type}")

Dim equiv As Boolean = template.IsEquivalentTo(template2)

Uwagi

Dwa UriTemplate wystąpienia są równoważne, jeśli ich ciągi literału są identyczne, a zmienne pojawiają się w tych samych segmentach. Na przykład "weather/{state}/{city}" jest odpowiednikiem "weather/{country}/{village}".

Dotyczy