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

XpoDefault.GetConnectionProvider(AutoCreateOption) Method

Creates an instance of a connection provider using settings from the XpoDefault.ActiveConnectionString.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v18.2.dll

Declaration

public static IDataStore GetConnectionProvider(
    AutoCreateOption defaultAutoCreateOption
)

Parameters

Name Type Description
defaultAutoCreateOption AutoCreateOption

A AutoCreateOption enumeration value that specifies the action which is performed when a session is connected to a data store.

Returns

Type Description
IDataStore

The created connection provider.

Example

The following code snippet shows how to create an instance of the SimpleDataLayer without first creating the data layer cache. The data layer is instantiated using the XpoDefault.ActiveConnectionString.

using DevExpress.Xpo;
using DevExpress.Xpo.DB;

//...

SimpleDataLayer dataLayer = new SimpleDataLayer(
    XpoDefault.GetConnectionProvider(AutoCreateOption.DatabaseAndSchema));
See Also