IdeaBlade.Core Assembly > IdeaBlade.Core.Composition Namespace > CompositionContext Class : Fake Field |
'Declaration
Public Shared Fake As CompositionContext
'Usage
Dim value As CompositionContext value = CompositionContext.Fake CompositionContext.Fake = value
public static CompositionContext Fake
public void SampleTestWithFakes() { // Sample showing use of the Fake composition context. // All queries and saves are processed by the EntityServerFakeBackingStore. var em = new DomainModelEntityManager(compositionContextName: CompositionContext.Fake.Name); // Create and save a new entity. var cust = new Customer() { CompanyName = "TestCo", Address = "123 Elm St" }; em.AddEntity(cust); em.SaveChanges(); // Clear the EM cache. em.Clear(); // Now query from the "server" - in this case the EntityServerFakeBackingStore. var customers = em.Customers.ToList(); }
The Fake context uses the EntityServerFakeBackingStore as its backing store, and uses fake query and save executors (note these are not the same thing as the EntityServerQueryInterceptor and EntityServerSaveInterceptor) to perform standard DevForce query and save processing against a fake backing store.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2