Skip to main content
.NET Framework 4.6.2+

Session(XPDictionary) Constructor

Initializes a new Session instance using the specified metadata provider.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.2.dll

Declaration

public Session(
    XPDictionary dictionary
)

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