Visual Basic (Declaration) | |
---|---|
Public Class EntityServerFakeBackingStore |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As EntityServerFakeBackingStore |
C# | |
---|---|
public class EntityServerFakeBackingStore |
C++/CLI | |
---|---|
public ref class EntityServerFakeBackingStore |
C# | ![]() |
---|---|
public void SampleTestWithFakeStore() { // Load some data for this sample and save to a file. var em = new DomainModelEntityManager(); em.Customers.ToList(); em.Employees.ToList(); string fileName = @"c:\temp\cachefile.bin"; em.CacheStateManager.SaveCacheState(fileName); // Create an EM with the Fake CompositionContext. var emFake = new DomainModelEntityManager(compositionContextName: CompositionContext.Fake.Name); // Load the fake backing store with the data cached to a file above. EntityServerFakeBackingStore.Local.Instance.Restore(fileName, RestoreStrategy.Normal); // Now issue queries with data from the fake store. var customersInUK = emFake.Customers.Where(c => c.Country == "UK").ToList(); } |
The EntityServerFakeBackingStore is automatically used when using the FakeCompositionContext. It is used by the EdmQueryExecutorFake and EdmSaveExecutorFake to provide a fake backing store for the EntityServer. The EntityServerFakeBackingStore.Local store is used for 2-tier (non-distributed) environments, while the EntityServerFakeBackingStore.Remote store is used in n-tier environments, such as a DevForce Silverlight application.
System.Object
IdeaBlade.EntityModel.EntityServerFakeBackingStore
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family