Skip to main content

DataStoreClientAsync Class

A data store provider that client applications can use to asynchronously work with the data source via WCF.

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public class DataStoreClientAsync :
    DataStoreClientAsyncBase<IDataStoreWarpServiceAsync>

Remarks

A DataStoreClientAsync instance 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. DataStoreClientAsync 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 DataStoreClientAsync 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.
IDataStoreAsync dataStoreAsync = new DataStoreClientAsync(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<IDataStoreWarpServiceAsync>
DevExpress.Xpo.DB.DataStoreClientBase<IDataStoreWarpServiceAsync>
DevExpress.Xpo.DB.DataStoreClientAsyncBase<IDataStoreWarpServiceAsync>
DataStoreClientAsync
See Also