/// <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);
/// <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);