Back to Devexpress

Session.Connect(IObjectLayer, IDisposable[]) Method

xpo-devexpress-dot-xpo-dot-session-dot-connect-x28-devexpress-dot-xpo-dot-iobjectlayer-system-dot-idisposable-x29.md

latest2.5 KB
Original Source

Session.Connect(IObjectLayer, IDisposable[]) Method

Connects the session to a data store using a specified object access layer.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public void Connect(
    IObjectLayer layer,
    params IDisposable[] disposeOnDisconnect
)
vb
Public Sub Connect(
    layer As IObjectLayer,
    ParamArray disposeOnDisconnect As IDisposable()
)

Parameters

NameTypeDescription
layerIObjectLayer

An object implementing the IObjectLayer interface. This object is assigned to the session’s Session.ObjectLayer property.

| | disposeOnDisconnect | IDisposable[] |

An array of objects to be automatically disposed of when the session is disconnected from a data store.

|

Remarks

Call this method to connect the current session to a data store via the layer, ignoring the session’s Session.ConnectionString and Session.Connection property settings.

The Connect method automatically assigns the layer to the session’s Session.ObjectLayer property. In addition, the session’s Session.Dictionary property is assigned the layer‘s Dictionary property value.

Note

The Connect method throws an exception if any of the following conditions are met:

  • The session is already connected to a data store.
  • Null ( Nothing in Visual Basic) is passed as the layer.

See Also

BeforeConnect

AfterConnect

Disconnect()

Session Class

Session Members

DevExpress.Xpo Namespace