UriTemplate.IsEquivalentTo(UriTemplate) 메서드

정의

UriTemplate이 다른 템플릿과 구조적으로 같은지 여부를 나타냅니다.

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

매개 변수

other
UriTemplate

비교할 UriTemplate입니다.

반환

Boolean

UriTemplate이 다른 템플릿과 구조적으로 같으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 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)

설명

리터럴 문자열이 같고 변수가 동일한 세그먼트에 나타난다면 두 UriTemplate 인스턴스는 동일합니다. 예를 들어 "weather/{state}/{city}"는 "weather/{country}/{village}"와 같습니다.

적용 대상