xpo-devexpress-dot-xpo-dot-db-35dac124.md
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.v25.2.dll
NuGet Package : DevExpress.Xpo
public class DataStoreClientAsync :
DataStoreClientAsyncBase<IDataStoreWarpServiceAsync>
Public Class DataStoreClientAsync
Inherits DataStoreClientAsyncBase(Of IDataStoreWarpServiceAsync)
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;
' Sample WCF service connection string.
Dim connectionString As String = "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 = Nothing
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;
' Specifying the name of the endpoint in the client application's configuration file.
Dim bindingName As String = "..."
' Creating a data store provider.
Dim dataStoreAsync As IDataStoreAsync = New DataStoreClientAsync(bindingName)
' Checking connection.
dataStore.AutoCreateOption.ToString()
XpoDefault.DataLayer = New SimpleDataLayer(dataStore)
XpoDefault.Session = Nothing
For more information on transferring data via WCF services, refer to Transferring Data via WCF Services.
Object ClientBase<IDataStoreWarpServiceAsync> DevExpress.Xpo.DB.DataStoreClientBase<IDataStoreWarpServiceAsync> DevExpress.Xpo.DB.DataStoreClientAsyncBase<IDataStoreWarpServiceAsync> DataStoreClientAsync
See Also