This documentation is archived and is not being maintained.
UriTemplateEquivalenceComparer::Equals Method (UriTemplate, UriTemplate)
Visual Studio 2010
Compares two UriTemplate instances for equivalence.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Parameters
- x
- Type: System::UriTemplate
A UriTemplate instance.
- y
- Type: System::UriTemplate
A UriTemplate instance.
Return Value
Type: System::BooleanA value that indicates whether the two UriTemplate instances are equivalent.
Implements
IEqualityComparer<T>::Equals(T, T)This method is not normally called directly. It is called by another class that is comparing two UriTemplate instances.
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);
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: