public override bool Equals(object obj)
        {
            var other = obj as MediaTypeHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return(_mediaType.Equals(other._mediaType, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(_parameters, other._parameters));
        }
Example #2
0
        public override bool Equals(object obj)
        {
            var other = obj as RangeHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return(StringSegment.Equals(_unit, other._unit, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(Ranges, other.Ranges));
        }
        public override bool Equals(object obj)
        {
            var other = obj as CacheControlHeaderValue;

            if (other == null)
            {
                return(false);
            }

            if ((_noCache != other._noCache) || (_noStore != other._noStore) || (_maxAge != other._maxAge) ||
                (_sharedMaxAge != other._sharedMaxAge) || (_maxStale != other._maxStale) ||
                (_maxStaleLimit != other._maxStaleLimit) || (_minFresh != other._minFresh) ||
                (_noTransform != other._noTransform) || (_onlyIfCached != other._onlyIfCached) ||
                (_public != other._public) || (_private != other._private) ||
                (_mustRevalidate != other._mustRevalidate) || (_proxyRevalidate != other._proxyRevalidate))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(_noCacheHeaders, other._noCacheHeaders,
                                                     StringSegmentComparer.OrdinalIgnoreCase))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(_privateHeaders, other._privateHeaders,
                                                     StringSegmentComparer.OrdinalIgnoreCase))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(_extensions, other._extensions))
            {
                return(false);
            }

            return(true);
        }