UriTemplate.IsEquivalentTo(UriTemplate) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
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}" に相当します。