public static FakeBackingStore Create(string compositionContextName) { var fakeBackingStore = new FakeBackingStore(compositionContextName); FakeBackingStores.Add(compositionContextName, fakeBackingStore); return fakeBackingStore; }
public static FakeBackingStore Create(string compositionContextName) { var fakeBackingStore = new FakeBackingStore(compositionContextName); FakeBackingStores.Add(compositionContextName, fakeBackingStore); return(fakeBackingStore); }
private void EnsureSampleData() { if (!FakeBackingStore.Exists(CompositionContext.Name)) { throw new InvalidOperationException(StringResources.TheFakeStoreHasNotBeenInitialized); } if (_storeEcs != null) { return; } PopulateStoreEcs(); }
/// <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); }
internal Task ResetFakeBackingStoreAsync() { EnsureSampleData(); return(FakeBackingStore.Get(CompositionContext.Name).ResetAsync(_storeEcs)); }