Back to Devexpress

XpoDefault.Session Property

xpo-devexpress-dot-xpo-dot-xpodefault-d1f98dd4.md

latest6.3 KB
Original Source

XpoDefault.Session Property

Gets or sets the default session.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public static Session Session { get; set; }
vb
Public Shared Property Session As Session

Property Value

TypeDescription
Session

A Session object that represents the default session which is used to load and save persistent objects.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Session property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XPO_how-to-implement-a-distributed-object-layer-service-working-via-wcf-e5072/CS/ConsoleApplication1/Program.cs#L17

csharp
XpoDefault.DataLayer = null;
XpoDefault.Session = null;
ObjectLayer = new SerializableObjectLayerClient(serializableObjectLayer);

XDL_how-to-convert-the-criteriaoperator-to-a-lambda-expression-to-use-it-for-iqueryable-e2596/CS/WindowsFormsApplication152/Program.cs#L21

csharp
XpoDefault.DataLayer = XpoDefault.GetDataLayer(connectionString, AutoCreateOption.DatabaseAndSchema);
XpoDefault.Session = null;

XPO_how-to-create-web-service-supporting-the-data-level-caching-e2740/CS/Client/XpoHelper.cs#L31

csharp
static IDataLayer GetDataLayer() {
    XpoDefault.Session = null;
    XPDictionary dict = new ReflectionDictionary();

XPO_how-to-connect-to-a-remote-data-service-instead-of-using-a-direct-database-connection-e4930/CS/ConsoleApplication1/Program.cs#L14

csharp
XpoDefault.Session = null;

XPO_how-to-create-a-data-caching-service-that-helps-improve-performance-in-distributed-e4932/CS/ConsoleApplication1/Program.cs#L22

csharp
XpoDefault.Session = null;

XPO_how-to-implement-a-distributed-object-layer-service-working-via-wcf-e5072/VB/ConsoleApplication1/Program.vb#L16

vb
XpoDefault.DataLayer = Nothing
XpoDefault.Session = Nothing
ObjectLayer = New SerializableObjectLayerClient(serializableObjectLayer)

XPO_how-to-generate-a-sequential-number-for-a-business-object-within-a-database-transaction-e2620/VB/ExplicitUnitOfWorkDemo/Program.vb#L20

vb
Dim cs As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
            XpoDefault.Session = Nothing
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:

XDL_how-to-convert-the-criteriaoperator-to-a-lambda-expression-to-use-it-for-iqueryable-e2596/VB/WindowsFormsApplication152/Program.vb#L18

vb
XpoDefault.DataLayer = XpoDefault.GetDataLayer(connectionString, AutoCreateOption.DatabaseAndSchema)
XpoDefault.Session = Nothing
Call CreateData()

XPO_how-to-connect-to-a-remote-data-service-instead-of-using-a-direct-database-connection-e4930/VB/ConsoleApplication1/Program.vb#L12

vb
XpoDefault.DataLayer = XpoDefault.GetDataLayer("http://localhost:55777/Service1.svc", AutoCreateOption.DatabaseAndSchema)
XpoDefault.Session = Nothing
Using uow As UnitOfWork = New UnitOfWork()

XPO_how-to-create-a-data-caching-service-that-helps-improve-performance-in-distributed-e4932/VB/ConsoleApplication1/Program.vb#L12

vb
XpoDefault.DataLayer = XpoDefault.GetDataLayer("http://localhost:55777/Service1.svc", AutoCreateOption.DatabaseAndSchema)
XpoDefault.Session = Nothing
Using uow As UnitOfWork = New UnitOfWork()

See Also

XpoDefault Class

XpoDefault Members

DevExpress.Xpo Namespace