Back to Devexpress

XpoDefault.GetDataLayer(XPDictionary, AutoCreateOption) Method

xpo-devexpress-dot-xpo-dot-xpodefault-dot-getdatalayer-x28-devexpress-dot-xpo-dot-metadata-dot-xpdictionary-devexpress-dot-xpo-dot-db-dot-autocreateoption-x29.md

latest2.8 KB
Original Source

XpoDefault.GetDataLayer(XPDictionary, AutoCreateOption) Method

Creates a data layer for the default connection string and specified metadata information.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public static IDataLayer GetDataLayer(
    XPDictionary dictionary,
    AutoCreateOption defaultAutoCreateOption
)
vb
Public Shared Function GetDataLayer(
    dictionary As XPDictionary,
    defaultAutoCreateOption As AutoCreateOption
) As IDataLayer

Parameters

NameTypeDescription
dictionaryXPDictionary

An XPDictionary object that provides the metadata information.

| | defaultAutoCreateOption | AutoCreateOption |

An AutoCreateOption value that specifies which operations should be performed when a data store is accessed for the first time.

|

Returns

TypeDescription
IDataLayer

The created SimpleDataLayer object.

|

Remarks

This method creates a corresponding IDataStore object based on the default connection string (returned by the XpoDefault.ActiveConnectionString property) and defaultAutoCreateOption parameter and then creates a SimpleDataLayer object that wraps the created IDataStore object.

The value returned by this method can be used to initialize the XpoDefault.DataLayer property or passed to a Session object’s constructor.

When you have finished working with a data layer you need to dispose of it to release the resources allocated by the data layer.

See Also

DataLayer

SimpleDataLayer

ThreadSafeDataLayer

XpoDefault Class

XpoDefault Members

DevExpress.Xpo Namespace