Exemplo n.º 1
0
 /// <summary>
 ///     Returns the hash code for the given instance.
 /// </summary>
 /// <param name="obj"> The instance. </param>
 /// <returns> The hash code. </returns>
 public virtual int GetHashCode(T?obj)
 => NonCapturingLazyInitializer.EnsureInitialized(
     ref _hashCode, this, c => c.HashCodeExpression.Compile())(obj);
Exemplo n.º 2
0
 /// <summary>
 ///     Compares the two instances to determine if they are equal.
 /// </summary>
 /// <param name="x"> The first instance. </param>
 /// <param name="y"> The second instance. </param>
 /// <returns> <see langword="true" /> if they are equal; <see langword="false" /> otherwise. </returns>
 public virtual bool Equals(T?x, T?y)
 => NonCapturingLazyInitializer.EnsureInitialized(
     ref _equals, this, c => c.EqualsExpression.Compile())(x, y);