예제 #1
0
        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);
        }
예제 #2
0
        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());
        }