Beispiel #1
0
        private IEnumerable <WasteContainer> GetSelectedContainersBelongingToDisposer(DisposerViewModel disposer)
        {
            var selectedContainerModels = FilteredContainers.Where(fc => fc.IsSelected)
                                          .Select(selectedContainer => selectedContainer.ContainerViewModel.Model);
            var containers = disposer.Containers.Where(selectedContainerModels.Contains)
                             .ToArray();

            return(containers);
        }
Beispiel #2
0
        private IEnumerable <DisposerViewModel> GetDisposersFromSelectedContainers()
        {
            var selectedContainerModels = FilteredContainers.Where(fc => fc.IsSelected)
                                          .Select(selectedContainer => selectedContainer.ContainerViewModel.Model);
            var disposers = m_Disposers.Where(d => d.Containers.Intersect(selectedContainerModels)
                                              .Any())
                            .Distinct()
                            .ToArray();

            return(disposers);
        }