Exemple #1
0
        private 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);
        }
        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);
        }