コード例 #1
0
 /// <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);
コード例 #2
0
 public static Value FK <T>(FK <T> x) where T : class => x.Key;