public void Returns_Key() { var key = _factory.GetKey(); string expected = $@"{_providerFactory.GetHashCode()}_{_connectionString.GetHashCode()}"; Assert.That(key, Is.EqualTo(expected)); }
/// <summary> /// Get the hash code for this key /// </summary> /// <returns></returns> /// <remarks> /// Other plugins of the same type are the same plugin, but user data mappers of the /// same type are not necessarily the same data mapper. /// </remarks> public override int GetHashCode() { var h = (Plugin.GetType()?.GetHashCode() ?? 0) ^ (Factory?.GetHashCode() ?? 0) ^ (ConnectionString?.GetHashCode() ?? 0) ^ (BareTableName?.GetHashCode() ?? 0) ^ (TableOwner?.GetHashCode() ?? 0) ^ (DataContract?.GetHashCode() ?? 0); return(h); }
/// <inheritdoc /> public override int GetHashCode() { return(_underlyingProvider.GetHashCode()); }
/// <summary> /// Serves as a hash function for a particular type. <see cref="M:System.Object.GetHashCode"></see> is suitable for use in hashing algorithms and data structures like a hash table. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"></see>. /// </returns> public override int GetHashCode() { return(m_underlyingFactory.GetHashCode()); }
public string GetKey() { return($"{_providerFactory.GetHashCode()}_{_connectionString.GetHashCode()}"); }