예제 #1
0
 /// <summary>
 /// Returns a value indicating the results of a comparison between two <see cref="SqlHierarchyId"/> nodes.
 /// </summary>
 /// <param name="hid">A <see cref="SqlHierarchyId"/> node to compare to this.</param>
 /// <returns>A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:
 /// <list type="table">
 ///   <listheader>
 ///       <term>Value</term>
 ///       <description>Meaning</description>
 ///   </listheader>
 ///   <item><term>Less than zero</term><description>this is less than <paramref name="hid"/>.</description></item>
 ///   <item><term>Zero</term><description>this is equal to <paramref name="hid"/>.</description></item>
 ///   <item><term>Greater than zero</term><description>this is greater than <paramref name="hid"/>.</description></item>
 /// </list>
 /// </returns>
 /// <remarks>
 /// If both <see cref="SqlHierarchyId"/> nodes are null, returns 0.
 /// If one <see cref="SqlHierarchyId"/> node is null, it is considered to be less than the non-null <see cref="SqlHierarchyId"/> node.
 /// </remarks>
 public int CompareTo(SqlHierarchyId hid)
 {
     if (IsNull)
     {
         if (!hid.IsNull)
         {
             return(-1);
         }
         return(0);
     }
     if (hid.IsNull)
     {
         return(1);
     }
     if (this < hid)
     {
         return(-1);
     }
     if (this > hid)
     {
         return(1);
     }
     return(0);
 }
예제 #2
0
 public SqlHierarchyId GetDescendant(SqlHierarchyId child1, SqlHierarchyId child2) => new SqlHierarchyId(_imp.GetDescendant(child1.IsNull ? default(HierarchyId?) : child1._imp, child2.IsNull ? default(HierarchyId?) : child2._imp));
예제 #3
0
 public SqlBoolean IsDescendantOf(SqlHierarchyId parent) => _imp.IsDescendantOf(parent._imp);
예제 #4
0
 private bool Equals(SqlHierarchyId other) => (IsNull && other.IsNull) || (this == other).IsTrue;