internal static bool Equals(SessionAffinityOptions options1, SessionAffinityOptions options2)
        {
            if (options1 == null && options2 == null)
            {
                return(true);
            }

            if (options1 == null || options2 == null)
            {
                return(false);
            }

            return(options1.Enabled == options2.Enabled &&
                   string.Equals(options1.Mode, options2.Mode, StringComparison.OrdinalIgnoreCase) &&
                   string.Equals(options1.FailurePolicy, options2.FailurePolicy, StringComparison.OrdinalIgnoreCase) &&
                   CaseInsensitiveEqualHelper.Equals(options1.Settings, options2.Settings));
        }
Exemple #2
0
        internal static bool Equals(Cluster cluster1, Cluster cluster2)
        {
            if (cluster1 == null && cluster2 == null)
            {
                return(true);
            }

            if (cluster1 == null || cluster2 == null)
            {
                return(false);
            }

            return(string.Equals(cluster1.Id, cluster2.Id, StringComparison.OrdinalIgnoreCase) &&
                   LoadBalancingOptions.Equals(cluster1.LoadBalancing, cluster2.LoadBalancing) &&
                   SessionAffinityOptions.Equals(cluster1.SessionAffinity, cluster2.SessionAffinity) &&
                   HealthCheckOptions.Equals(cluster1.HealthCheck, cluster2.HealthCheck) &&
                   ProxyHttpClientOptions.Equals(cluster1.HttpClient, cluster2.HttpClient) &&
                   ProxyHttpRequestOptions.Equals(cluster1.HttpRequest, cluster2.HttpRequest) &&
                   CaseInsensitiveEqualHelper.Equals(cluster1.Destinations, cluster2.Destinations, Destination.Equals) &&
                   CaseInsensitiveEqualHelper.Equals(cluster1.Metadata, cluster2.Metadata));
        }