public static FakeBackingStore Create(string compositionContextName)
        {
            var fakeBackingStore = new FakeBackingStore(compositionContextName);
            FakeBackingStores.Add(compositionContextName, fakeBackingStore);

            return fakeBackingStore;
        }
Example #2
0
        public static FakeBackingStore Create(string compositionContextName)
        {
            var fakeBackingStore = new FakeBackingStore(compositionContextName);

            FakeBackingStores.Add(compositionContextName, fakeBackingStore);

            return(fakeBackingStore);
        }
Example #3
0
        private void EnsureSampleData()
        {
            if (!FakeBackingStore.Exists(CompositionContext.Name))
            {
                throw new InvalidOperationException(StringResources.TheFakeStoreHasNotBeenInitialized);
            }

            if (_storeEcs != null)
            {
                return;
            }

            PopulateStoreEcs();
        }
Example #4
0
        /// <summary>
        ///   Initializes the fake backing store.
        /// </summary>
        /// <returns> Returns true if the EntityManagerProvider supports the fake backing store. </returns>
        public static bool InitializeFakeBackingStore <T>(this IEntityManagerProvider <T> @this) where T : EntityManager
        {
            if ([email protected])
            {
                DebugFns.WriteLine(StringResources.NonSuitableEmpForFakeStoreOperation);
                return(false);
            }

            // Return if already initialized
            if (FakeBackingStore.Exists(@this.Manager.CompositionContext.Name))
            {
                return(true);
            }

            FakeBackingStore.Create(@this.Manager.CompositionContext.Name);

            ResetFakeBackingStore(@this);
            return(true);
        }
Example #5
0
 internal Task ResetFakeBackingStoreAsync()
 {
     EnsureSampleData();
     return(FakeBackingStore.Get(CompositionContext.Name).ResetAsync(_storeEcs));
 }