Back to Devexpress

IObjectSpaceLink.ObjectSpace Property

expressappframework-devexpress-dot-expressapp-dot-iobjectspacelink.md

latest5.1 KB
Original Source

IObjectSpaceLink.ObjectSpace Property

Specifies an Object Space associated with the current IObjectSpaceLink object.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
IObjectSpace ObjectSpace { get; set; }
vb
Property ObjectSpace As IObjectSpace

Property Value

TypeDescription
IObjectSpace

An IObjectSpace object associated with the current object.

|

Remarks

Refer to the IXafEntityObject interface description to see how to implement and use the ObjectSpace property in your business class.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ObjectSpace 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.

XAF_Non-Persistent-Objects-Reloading-Demo/CS/EFCore/NonPersReloadEF/NonPersReloadEF.Module/BusinessObjects/LiveSummary.cs#L124

csharp
var link = obj as IObjectSpaceLink;
if(link == null || link.ObjectSpace == null || link.ObjectSpace.IsNewObject(obj)) {
    return null;

xaf-save-and-share-custom-view-settings/CS/EFCore/ViewSettingsEF/ViewSettingsEF.Module/Controllers/ViewVariantsController.cs#L91

csharp
if(TryLoadViewVariantFromXML(defaultUserSettings)) {
    IObjectSpace os = currentLayoutItem.ObjectSpace;
    os.Delete(currentLayoutItem);

XAF-CRUD-for-Non-Persistent-Objects-Stored-Remotely/CS/NonPersistentObjectsDemo.Module/TransientNonPersistentObjectAdapter.cs#L77

csharp
var link = (IObjectSpaceLink)e.SourceObject;
if(objectSpace.Equals(link.ObjectSpace) && (objectMap.Contains(e.SourceObject) || IsNewObject(e.SourceObject))) {
    e.TargetObject = e.SourceObject;

XAF_Non-Persistent-Objects-Nested-In-Persistent-Objects-Demo/CS/XPO/NonPersistentDemo/NonPersistentDemo.Module/BusinessObjects/NonPersistentObjectAdapter.cs#L90

csharp
GuardKeyNotEmpty(obj);
if(link.ObjectSpace == null) {
    e.TargetObject = AcceptOrUpdate(obj);

xaf-filter-lookup-list-views/CS/EFCore/FilterLookupEF/FilterLookupEF.Module/BusinessObjects/Order.cs#L53

csharp
private void RefreshAvailableAccessories() {
    var os = ((IObjectSpaceLink)this).ObjectSpace;
    IQueryable<Accessory> available;

XAF-CRUD-for-Non-Persistent-Objects-Stored-Remotely/VB/NonPersistentObjectsDemo.Module/TransientNonPersistentObjectAdapter.vb#L75

vb
Dim link = DirectCast(e.SourceObject, IObjectSpaceLink)
If objectSpace.Equals(link.ObjectSpace) AndAlso (objectMap.Contains(e.SourceObject) OrElse IsNewObject(e.SourceObject)) Then
    e.TargetObject = e.SourceObject

See Also

IObjectSpaceLink Interface

IObjectSpaceLink Members

DevExpress.ExpressApp Namespace