/// <summary> /// Returns whether the provided URIs reference the same object. /// Two uri are the "same" if their hierarchies match (1.3.1.1/1.4.1.1) or if their object ids are equal (2.0). /// </summary> /// <param name="u"></param> /// <param name="v"></param> /// <returns></returns> public static bool AreSame(EtpUri u, EtpUri v) { if (!u.IsRelatedTo(v)) { return(false); } if (u.IsRelatedTo(EtpUris.Witsml200) && u.ObjectType.EqualsIgnoreCase(v.ObjectType) && !string.IsNullOrEmpty(u.ObjectId) && u.ObjectId.EqualsIgnoreCase(v.ObjectId)) { return(true); } return(u.Equals(v)); }
/// <summary> /// Determines whether the left parts of two URIs are equal. /// </summary> /// <param name="uri">The URI.</param> /// <param name="other">The other URI.</param> /// <returns><c>true</c> if the left parts are equal; otherwise, <c>false</c>.</returns> public static bool EqualsLeftPart(this EtpUri uri, EtpUri other) { return(uri.Equals(other.WithoutQuery())); }