IdeaBlade DevForce 2010 Help Reference
EntityServerFakeBackingStore Class
Members  Example  See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace : EntityServerFakeBackingStore Class



A fake which can be used to provide a non-database backing store during testing.

Syntax

Visual Basic (Declaration) 
Public Class EntityServerFakeBackingStore 
Visual Basic (Usage)Copy Code
Dim instance As EntityServerFakeBackingStore
C# 
public class EntityServerFakeBackingStore 
C++/CLI 
public ref class EntityServerFakeBackingStore 

Example

C#Copy Code
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();
 }

Remarks

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.

Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.EntityServerFakeBackingStore

Requirements

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

See Also

© 2013 All Rights Reserved.