public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            MethodCachingPolicyConfig other = obj as MethodCachingPolicyConfig;

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

            return(Enabled == other.Enabled &&
                   ResponseKindsToCache == other.ResponseKindsToCache &&
                   ResponseKindsToIgnore == other.ResponseKindsToIgnore &&
                   RefreshMode == other.RefreshMode &&
                   RefreshTime == other.RefreshTime &&
                   ExpirationTime == other.ExpirationTime &&
                   FailedRefreshDelay == other.FailedRefreshDelay &&
                   RequestGroupingBehavior == other.RequestGroupingBehavior &&
                   RefreshBehavior == other.RefreshBehavior &&
                   RevokedResponseBehavior == other.RevokedResponseBehavior &&
                   ExpirationBehavior == other.ExpirationBehavior &&
                   CacheResponsesWhenSupressedBehavior == other.CacheResponsesWhenSupressedBehavior &&
                   NotIgnoredResponseBehavior == other.NotIgnoredResponseBehavior);
        }
예제 #2
0
        public void OnDeserialized(StreamingContext context)
        {
            DefaultItem = new MethodCachingPolicyConfig
            {
                Enabled            = Enabled ?? Default.Enabled,
                ExpirationTime     = ExpirationTime ?? Default.ExpirationTime,
                FailedRefreshDelay = FailedRefreshDelay ?? Default.FailedRefreshDelay,
                RefreshTime        = RefreshTime ?? Default.RefreshTime
            };

            var methods = (IDictionary <string, MethodCachingPolicyConfig>)Methods ?? new Dictionary <string, MethodCachingPolicyConfig>();

            Methods = new CachingPolicyCollection(methods, DefaultItem);
        }
예제 #3
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            MethodCachingPolicyConfig other = obj as MethodCachingPolicyConfig;

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

            return(Enabled == other.Enabled &&
                   RefreshTime == other.RefreshTime &&
                   ExpirationTime == other.ExpirationTime);
        }