public static void Update()

in src/Authentication.Abstractions/Extensions/AzureEnvironmentExtensions.cs [599:694]


        public static void Update(this IAzureEnvironment environment, IAzureEnvironment other)
        {
            if (environment != null && other != null && environment != other)
            {
                environment.OnPremise = other.OnPremise;
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId))
                {
                    environment.ActiveDirectoryServiceEndpointResourceId = other.ActiveDirectoryServiceEndpointResourceId;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.AdTenant))
                {
                    environment.AdTenant = other.AdTenant;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.Gallery))
                {
                    environment.GalleryUrl = other.GalleryUrl;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.ManagementPortalUrl))
                {
                    environment.ManagementPortalUrl = other.ManagementPortalUrl;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.ServiceManagement))
                {
                    environment.ServiceManagementUrl = other.ServiceManagementUrl;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.PublishSettingsFileUrl))
                {
                    environment.PublishSettingsFileUrl = other.PublishSettingsFileUrl;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.ResourceManager))
                {
                    environment.ResourceManagerUrl = other.ResourceManagerUrl;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix))
                {
                    environment.SqlDatabaseDnsSuffix = other.SqlDatabaseDnsSuffix;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.StorageEndpointSuffix))
                {
                    environment.StorageEndpointSuffix = other.StorageEndpointSuffix;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.ActiveDirectory))
                {
                    environment.ActiveDirectoryAuthority = other.ActiveDirectoryAuthority;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.Graph))
                {
                    environment.GraphUrl = other.GraphUrl;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.GraphEndpointResourceId))
                {
                    environment.GraphEndpointResourceId = other.GraphEndpointResourceId;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix))
                {
                    environment.TrafficManagerDnsSuffix = other.TrafficManagerDnsSuffix;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix))
                {
                    environment.AzureKeyVaultDnsSuffix = other.AzureKeyVaultDnsSuffix;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix))
                {
                    environment.AzureDataLakeStoreFileSystemEndpointSuffix = other.AzureDataLakeStoreFileSystemEndpointSuffix;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix))
                {
                    environment.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix =
                         other.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId))
                {
                    environment.AzureKeyVaultServiceEndpointResourceId =
                         other.AzureKeyVaultServiceEndpointResourceId;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.DataLakeEndpointResourceId))
                {
                    environment.DataLakeEndpointResourceId = other.DataLakeEndpointResourceId;
                }
                if (other.IsEndpointSet(AzureEnvironment.Endpoint.ContainerRegistryEndpointSuffix))
                {
                    environment.ContainerRegistryEndpointSuffix = other.ContainerRegistryEndpointSuffix;
                }

                foreach (var profile in other.VersionProfiles)
                {
                    if (!environment.VersionProfiles.Contains(profile))
                    {
                        environment.VersionProfiles.Add(profile);
                    }
                }

                environment.UpdateProperties(other);
            }

        }