UriTemplateEquivalenceComparer.Equals(UriTemplate, UriTemplate) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Compares two UriTemplate instances for equivalence.
public:
virtual bool Equals(UriTemplate ^ x, UriTemplate ^ y);
public bool Equals (UriTemplate x, UriTemplate y);
override this.Equals : UriTemplate * UriTemplate -> bool
Public Function Equals (x As UriTemplate, y As UriTemplate) As Boolean
Parameters
A UriTemplate instance.
A UriTemplate instance.
Returns
A value that indicates whether the two UriTemplate instances are equivalent.
Implements
Examples
The following code shows how to call the Equals method.
UriTemplate temp1 = new UriTemplate("weather/{state}/{city}");
UriTemplate temp2 = new UriTemplate("weather/{country}/{village}");
// Notice they are not reference equal, in other words
// they are do not refer to the same object
if (temp1 == temp2)
Console.WriteLine("{0} and {1} are reference equal", temp1, temp2);
else
Console.WriteLine("{0} and {1} are NOT reference equal", temp1, temp2);
// Notice they are structrually equal
UriTemplateEquivalenceComparer comparer = new UriTemplateEquivalenceComparer();
bool result = comparer.Equals(temp1, temp2);
if (result)
Console.WriteLine("{0} and {1} are structurally equal", temp1, temp2);
else
Console.WriteLine("{0} and {1} are NOT structurally equal", temp1, temp2);
Remarks
This method is not normally called directly. It is called by another class that is comparing two UriTemplate instances.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET