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

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

            IsInitialized = true;
        }
        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;
        }
Beispiel #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;
        }
Beispiel #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();
        }
Beispiel #6
0
 public void Restore(EntityCacheState cacheState)
 {
     EntityManager.CacheStateManager.RestoreCacheState(cacheState);
     IsRestored = true;
 }