private void MakeVms() { var vocs = EntityQuery <Vocabulary> .All(Session)(); var vms = vocs.Select(v => Vocs .Where(vm => vm.voc == v) .FirstOrDefault() ?? new VocabularyViewModel(v)); Vocs.SyncWith(vms); }
private int MakeInstalledVms() { var vms = VocabularyQuery.NonCustom(Session)() .Select(voc => Vocs .Where(vm => vm.voc == voc) .FirstOrDefault() ?? new VocabularyViewModel(voc)) .ToList(); uiTaskFactory.StartNew(() => Vocs.SyncWith(vms)); return(vms.Count()); }