Back to Devexpress

Session.Dictionary Property

xpo-devexpress-dot-xpo-dot-session-aac824e4.md

latest5.7 KB
Original Source

Session.Dictionary Property

Gets metadata on persistent objects in a data store.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
[Browsable(false)]
public virtual XPDictionary Dictionary { get; }
vb
<Browsable(False)>
Public Overridable ReadOnly Property Dictionary As XPDictionary

Property Value

TypeDescription
XPDictionary

An XPDictionary object which provides metadata on persistent objects in a data store.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Dictionary 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-persist-metadata-e269/CS/Program.cs#L79

csharp
XPCollection<PersistentClassInfo> classes = new XPCollection<PersistentClassInfo>(metadataSession);
    PersistentClassInfo.FillDictionary(dataSession.Dictionary, classes);
}

XPO_how-to-create-an-xpclassinfo-descendant-to-dynamically-build-a-persistent-class-structure-e1729/CS/DynamicDataTable/Form1.cs#L45

csharp
if (!dynamicClasses.TryGetValue(tableName, out dataTableClassInfo)) {
    dynamicClasses.Add(tableName, new DynamicDataTableClassInfo(workSession.Dictionary, dataTable));
}

XPO_how-to-generate-persistent-metadata-for-an-arbitrary-data-table-e2922/CS/MapArbitraryDatabaseExample/Form1.cs#L22

csharp
DBTable[] tables = provider.GetStorageTables("Product");
    gridControl2.DataSource = new XPCollection(session1, Program.AddClass(session1.Dictionary, tables[0]));
}

XPO_how-to-reuse-xaf-audit-trail-module-functionality-in-a-non-xaf-winforms-application-e2274/CS/WinExample/Form1.cs#L21

csharp
session1.Dictionary.GetDataStoreSchema(typeof(PersistentObject1).Assembly);
AuditTrailService.GetService(null).SetXPDictionary(session1.Dictionary);
AuditTrailService.GetService(null).AuditDataStore = new AuditDataStore<AuditDataItemPersistent, AuditedObjectWeakReference>();

XPO_how-to-bind-data-to-winforms-controls-using-xpbindingsource/CS/DXApplication/Form1.cs#L75

csharp
CategoryListSource.DataSource = UnitOfWork.Query<Categories>().OrderBy(t => t.CategoryName).ToList();
CategoryListSource.Dictionary = UnitOfWork.Dictionary;
SupplierListSource.DataSource = new XPCollection<Suppliers>(UnitOfWork, null, new SortProperty("CompanyName", SortingDirection.Ascending));

XPO_how-to-persist-metadata-e269/VB/Program.vb#L69

vb
Dim classes As XPCollection(Of PersistentClassInfo) = New XPCollection(Of PersistentClassInfo)(metadataSession)
    PersistentClassInfo.FillDictionary(dataSession.Dictionary, classes)
End Using

XPO_how-to-create-an-xpclassinfo-descendant-to-dynamically-build-a-persistent-class-structure-e1729/VB/DynamicDataTable/Form1.vb#L47

vb
If Not dynamicClasses.TryGetValue(tableName, dataTableClassInfo) Then
    dynamicClasses.Add(tableName, New DynamicDataTableClassInfo(workSession.Dictionary, dataTable))
End If

XPO_how-to-bind-data-to-winforms-controls-using-xpbindingsource/VB/DXApplication/Form1.vb#L61

vb
CategoryListSource.DataSource = UnitOfWork.Query(Of Categories)().OrderBy(Function(t) t.CategoryName).ToList()
CategoryListSource.Dictionary = UnitOfWork.Dictionary
SupplierListSource.DataSource = New XPCollection(Of Suppliers)(UnitOfWork, Nothing, New SortProperty("CompanyName", SortingDirection.Ascending))

See Also

Session Class

Session Members

DevExpress.Xpo Namespace