The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Session.Connect(IObjectLayer, IDisposable[]) Method

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

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

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

Parameters

Name Type Description
layer IObjectLayer

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.

Parameters

Name Type Description
layer IObjectLayer

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