コード例 #1
0
        private static void UpdateEntitySet(IEntityViewCacheViewModel <TView> cacheViewModel,
                                            IEntityViewWithChangesUpdated <TView> msg)
        {
            var existingEntity = cacheViewModel.EntitySet.Value.FirstOrDefault(x => x.Id == msg.Entity.Id);

            if (existingEntity != null)
            {
                cacheViewModel.EntitySet.Value.Remove(existingEntity);
            }

            cacheViewModel.EntitySet.Value.Add(msg.Entity);
            cacheViewModel.EntitySet.Value.Reset();
        }
コード例 #2
0
 private static void ReloadEntitySet(IEntityViewCacheViewModel <TView> v, IEntityViewSetWithChangesLoaded <TView> e)
 {
     v.EntitySet.Value.Clear();
     v.EntitySet.Value.AddRange(e.EntitySet);
     v.EntitySet.Value.Reset();
 }