/// <summary> /// Compare the FK for equality. /// </summary> /// <param name="other">The other key to compare against.</param> /// <returns>True if the foreign references are equal, false otherwise.</returns> public bool Equals(FK <T> other) => ReferenceEquals(this, other) || key != null && (key == other.key || key.Id() == other.key?.Id() && key.Id() != 0) || value != null && EqualityComparer <T> .Default.Equals(value, other.value);
public static Value FK <T>(FK <T> x) where T : class => x.Key;