Exemplo n.º 1
0
        public void Reset(EntityCacheState storeEcs)
        {
            // Clear all data from the backing store
            Store.Clear();
            Store.Restore(storeEcs);

            IsInitialized = true;
        }
Exemplo n.º 2
0
        public void Reset(EntityCacheState storeEcs)
        {
            // Clear all data from the backing store
            Store.Clear();
            Store.Restore(storeEcs);

            IsInitialized = true;
        }
Exemplo n.º 3
0
        public async Task ResetAsync(EntityCacheState storeEcs)
        {

#if !SILVERLIGHT && !NETFX_CORE
            // If the local fake backing store is used, do it synchronously
            if (Store is EntityServerFakeBackingStore.Local)
            {
                Reset(storeEcs);
                return;
            }
#endif
            // Clear all data from the backing store
            await Store.ClearAsync();
            await Store.RestoreAsync(storeEcs);

            IsInitialized = true;
        }
Exemplo n.º 4
0
        public async Task ResetAsync(EntityCacheState storeEcs)
        {
#if !SILVERLIGHT && !NETFX_CORE
            // If the local fake backing store is used, do it synchronously
            if (Store is EntityServerFakeBackingStore.Local)
            {
                Reset(storeEcs);
                return;
            }
#endif
            // Clear all data from the backing store
            await Store.ClearAsync();

            await Store.RestoreAsync(storeEcs);

            IsInitialized = true;
        }
Exemplo n.º 5
0
        private void PopulateStoreEcs()
        {
            // Create a separate isolated EntityManager
            var manager = CreateEntityManager();

            manager.Options.UseDefaultAuthenticationContext = false;
            manager.AuthenticationContext          = AnonymousAuthenticationContext.Instance;
            manager.DefaultQueryStrategy           = QueryStrategy.CacheOnly;
            manager.DefaultEntityReferenceStrategy = EntityReferenceStrategy.NoLoad;

            if (SampleDataProviders != null)
            {
                SampleDataProviders.ForEach(p => p.AddSampleData(manager));
            }

            _storeEcs = manager.CacheStateManager.GetCacheState();
            // We used the manager just to get the ECS; now clear it out
            manager.Clear();
        }
Exemplo n.º 6
0
 public void Restore(EntityCacheState cacheState)
 {
     EntityManager.CacheStateManager.RestoreCacheState(cacheState);
     IsRestored = true;
 }