xpo-devexpress-dot-xpo-dot-xpodefault-d1f98dd4.md
Gets or sets the default session.
Namespace : DevExpress.Xpo
Assembly : DevExpress.Xpo.v25.2.dll
NuGet Package : DevExpress.Xpo
public static Session Session { get; set; }
Public Shared Property Session As Session
| Type | Description |
|---|---|
| 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.
XpoDefault.DataLayer = null;
XpoDefault.Session = null;
ObjectLayer = new SerializableObjectLayerClient(serializableObjectLayer);
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
static IDataLayer GetDataLayer() {
XpoDefault.Session = null;
XPDictionary dict = new ReflectionDictionary();
XpoDefault.Session = null;
XpoDefault.Session = null;
XpoDefault.DataLayer = Nothing
XpoDefault.Session = Nothing
ObjectLayer = New SerializableObjectLayerClient(serializableObjectLayer)
Dim cs As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
XpoDefault.Session = Nothing
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
XpoDefault.DataLayer = XpoDefault.GetDataLayer(connectionString, AutoCreateOption.DatabaseAndSchema)
XpoDefault.Session = Nothing
Call CreateData()
XpoDefault.DataLayer = XpoDefault.GetDataLayer("http://localhost:55777/Service1.svc", AutoCreateOption.DatabaseAndSchema)
XpoDefault.Session = Nothing
Using uow As UnitOfWork = New UnitOfWork()
XpoDefault.DataLayer = XpoDefault.GetDataLayer("http://localhost:55777/Service1.svc", AutoCreateOption.DatabaseAndSchema)
XpoDefault.Session = Nothing
Using uow As UnitOfWork = New UnitOfWork()
See Also