Skip to main content
A newer version of this page is available. .

DataStoreClient Class

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

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Xpo.v18.2.dll

Declaration

public class DataStoreClient :
    DataStoreClientBase<IDataStoreWarpService>

Remarks

DataStoreClient can be created using the XpoDefault.GetConnectionProvider method if you pass a connection string to a service (an IDataStoreService implementor, such as a DataStoreService descendant) as a method parameter. DataStoreClient objects are automatically created to maintain a data store connection on the client side when you create a data layer via the XpoDefault.GetDataLayer method call with a connection string to a service. The client created in this manner uses BasicHttpBinding configured with default parameters except for MaxReceivedMessageSize and ReaderQuotas, which are set to maximum values.


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

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

To use a specific endpoint and binding configurations, create the DataStoreClient object using a constructor and pass either the configuration name or programmatically configured endpoint and binding objects.


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

// Creating a data store provider.
IDataStore dataStore = new DataStoreClient(bindingName);
// Checking connection.
dataStore.AutoCreateOption.ToString();

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

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

Inheritance

Object
ClientBase<DevExpress.Xpo.DB.IDataStoreWarpService>
DevExpress.Xpo.DB.DataStoreClientBase<DevExpress.Xpo.DB.IDataStoreWarpService>
DataStoreClient
See Also