Filter() 공개 메소드

public Filter ( IEnumerable machines ) : IEnumerable
machines IEnumerable
리턴 IEnumerable
        private IEnumerable<MachineResource> FilterByState(IEnumerable<MachineResource> environmentMachines)
        {
            var provider = new HealthStatusProvider(Repository, Log, statuses, healthStatuses);
            environmentMachines = provider.Filter(environmentMachines);

            if (isDisabled.HasValue)
            {
                environmentMachines = environmentMachines.Where(m => m.IsDisabled == isDisabled.Value);
            }
            if (isCalamariOutdated.HasValue)
            {
                environmentMachines = environmentMachines.Where(m => m.HasLatestCalamari == !isCalamariOutdated.Value);
            }
            if (isTentacleOutdated.HasValue)
            {
                environmentMachines = environmentMachines.Where(m => (m.Endpoint as ListeningTentacleEndpointResource)?.TentacleVersionDetails.UpgradeSuggested == isTentacleOutdated.Value);
            }
            return environmentMachines;
        }
        private IEnumerable <MachineResource> FilterByState(IEnumerable <MachineResource> environmentMachines)
        {
            var provider = new HealthStatusProvider(Repository, Log, statuses, healthStatuses);

            environmentMachines = provider.Filter(environmentMachines);

            if (isDisabled.HasValue)
            {
                environmentMachines = environmentMachines.Where(m => m.IsDisabled == isDisabled.Value);
            }
            if (isCalamariOutdated.HasValue)
            {
                environmentMachines = environmentMachines.Where(m => m.HasLatestCalamari == !isCalamariOutdated.Value);
            }
            if (isTentacleOutdated.HasValue)
            {
                environmentMachines = environmentMachines.Where(m => (m.Endpoint as ListeningTentacleEndpointResource)?.TentacleVersionDetails.UpgradeSuggested == isTentacleOutdated.Value);
            }
            return(environmentMachines);
        }