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(XPDictionary) Constructor

Initializes a new Session instance using the specified metadata provider.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public Session(
    XPDictionary dictionary
)
Public Sub New(
    dictionary As XPDictionary
)
public Session(
    XPDictionary dictionary
)
Public Sub New(
    dictionary As XPDictionary
)

Parameters

Name Type Description
dictionary XPDictionary

An XPDictionary object, which is the metadata provider to be used by the newly instantiated session. This value is assigned to the Session.Dictionary property.

Parameters

Name Type Description
dictionary XPDictionary

An XPDictionary object, which is the metadata provider to be used by the newly instantiated session. This value is assigned to the Session.Dictionary property.

Remarks

This constructor is intended primarily for compatibility with legacy applications. It is recommended to use session constructors taking a data layer as an argument. However, you can use this constructor when you do not have an existing data layer, and you are going to manually specify a connection string for the new session.


Session se = new Session(Dictionary);
se.ConnectionString = connectionString;
se.Connect();

In this instance, a default data layer will be ignored and the session instance will connect to the database using the specified connection string. If you do not specify the session connection string before calling the Session.Connect method, and there is an already instantiated default data layer, an exception will be thrown. The reason for this is that the default data layer has its own metadata provider and this constructor cannot be used.

See Also