The requested page is not available for the requested platform. You are viewing the content for Default platform.

BaseObject.Oid Property

Specifies the persistent object's identifier.

Namespace: DevExpress.Persistent.BaseImpl

Assembly: DevExpress.Persistent.BaseImpl.v19.1.dll

Declaration

[PersistentAlias("oid")]
[VisibleInListView(false)]
[VisibleInDetailView(false)]
[VisibleInLookupListView(false)]
public Guid Oid { get; }
<PersistentAlias("oid")>
<VisibleInListView(False)>
<VisibleInDetailView(False)>
<VisibleInLookupListView(False)>
Public ReadOnly Property Oid As Guid

Property Value

Type Description
Guid

A globally unique identifier which represents the persistent object's identifier.

Remarks

To distinguish between different business objects and correctly identify them, the BaseObject class exposes the Oid property. This is an auto-generated property, meaning you do not need to assign identifier values for each persistent object. The Oid property can also be referred to as a primary key property, since it is represented by a primary key in the database.

Note that when OidInitializationMode is set to OnSaving, new persistent objects have Guid.Empty as the Oid property value after they are created. The property gains a final value after the object is saved to the database.

The XPObjectSpace class exposes a number of methods that take the value returned by a business object's Oid property as a parameter. These methods allow you to find a particular object by its key property value, as well as perform additional actions based on it. The following table lists these methods.

Note

The BaseObject's Oid property, as well as other base classes key properties, is not designed to be manually set. In fact, this is not supported and should never be done. Under normal circumstances, the Oid property does not even expose a setter.

See Also