.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Session(IDataLayer, IDisposable[]) Constructor

Initializes a new instance of the Session class and connects it to a data store.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v21.2.dll


public Session(
    IDataLayer layer,
    params IDisposable[] disposeOnDisconnect


Name Type Description
layer IDataLayer

An object which implements the IDataLayer interface. This value is assigned to the Session.DataLayer property.

disposeOnDisconnect IDisposable[]

An array of objects that implement the System.IDisposable interface. These objects are automatically disposed of when the session is disconnected.


This constructor automatically creates a SimpleObjectLayer instance for the specified layer and calls the overloaded constructor that accepts an object layer (IObjectLayer implementation) as the parameter.

See Also