BaseObject.Oid Property

Specifies the persistent object's identifier.

Namespace: DevExpress.Persistent.BaseImpl

Assembly: DevExpress.Persistent.BaseImpl.v18.2.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 after a new object is created, and until it is persisted in the database, the Oid property returns Guid.Empty (all zeroes). So, until an object is persisted in a database, it does not have a unique identifier.

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