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

返品

true UriTemplateが他のと構造的に等しい場合は >。それ以外の場合は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)

注釈

リテラル文字列が同じで、変数が同じセグメントに出現する場合、2 つの UriTemplate インスタンスは同等です。 たとえば、"weather/{state}/{city}" は "weather/{country}/{village}" に相当します。

適用対象