Skip to main content

CachedDataStoreClient Class

A cached data store provider (an ICachedDataStore implementation) for client applications transferring data via WCF.

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Xpo.v23.2.dll

NuGet Package: DevExpress.Xpo

Declaration

public class CachedDataStoreClient :
    CachedDataStoreClientBase<ICachedDataStoreWarpService>

Remarks

CachedDataStoreClient objects are automatically created to maintain a cache (DataCacheNode) on the client side when you create a data layer via the XpoDefault.GetDataLayer method call and pass a connection string to a service (an ICachedDataStoreService implementor, such as a CachedDataStoreService descendant) as a method parameter.

// Sample WCF service connection string.
string connectionString = "http://localhost:64466/Service.svc";

// GetDataLayer automatically creates 
// a cached data store provider (and a cache) based on the connection string.
XpoDefault.DataLayer = XpoDefault.GetDataLayer(connectionString, AutoCreateOption.DatabaseAndSchema);
XpoDefault.Session = null;

If you are going to create a cache hierarchy at the client, you can manually create CachedDataStoreClient objects as shown below.

// Specifying the name of the endpoint in the client application's configuration file.
string bindingName = "...";

// Creating a cache (a node starting a cache hierarchy at the client).
DataCacheNode node = new DataCacheNode(new CachedDataStoreClient(bindingName));
// Checking connection.
node.ProcessCookie(DataCacheCookie.Empty);

XpoDefault.DataLayer = new SimpleDataLayer(node);
XpoDefault.Session = null;

For more information on transferring data via WCF services, refer to Transferring Data via WCF Services.

Inheritance

Object
ClientBase<ICachedDataStoreWarpService>
DevExpress.Xpo.DB.DataStoreClientBase<ICachedDataStoreWarpService>
DevExpress.Xpo.DB.CachedDataStoreClientBase<ICachedDataStoreWarpService>
CachedDataStoreClient
See Also