XpoDefault.GetConnectionProvider(AutoCreateOption) Method
Creates an instance of a connection provider using settings from the XpoDefault.ActiveConnectionString.
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v19.1.dll
Declaration
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