public override bool Equals(object?obj) { if (object.ReferenceEquals(this, obj)) { return(true); } if (this.GetType() == obj?.GetType()) { CachedSpecification <T, K> other = (CachedSpecification <T, K>)obj; return(this.Equals(other)); } return(false); }
public bool Equals(CachedSpecification <T, K>?other) { if (object.ReferenceEquals(this, other)) { return(true); } if (other is null) { return(false); } return(EqualityComparer <K> .Default.Equals(this.Key, other.Key) && (this.CacheDuration == other.CacheDuration) && base.Equals(other)); }