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); }