Implementation of Equals and GetHashCode for base class
I think you are overcomplicating things you can say simple this:

    public abstract class Entity&lt;TKey&gt; where TKey : struct 
    {
        public abstract TKey Key { get; }

        protected bool Equals(Entity&lt;TKey&gt; other)
        {
            return Key.Equals(other.Key);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            var asThis = obj as Entity&lt;TKey&gt;;
            return asThis != null &amp;&amp; Equals(asThis);
        }

        public override int GetHashCode()
        {
            return Key.GetHashCode();
        }
    }


No need the type magic
A key cannot be null and it should be a ValueType
An Equals and GetHashCode implementation should be symmetric and fast (your solution is slow and i'm not sure it is symmetric or not)