Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Session.SetKeyValue(Object, Object) Method

Assigns the key property’s value of the specified persistent object.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public void SetKeyValue(
    object theObject,
    object keyValue
)

Parameters

Name Type Description
theObject Object

A persistent object whose key property value is set.

keyValue Object

An object representing the key property’s value.

Remarks

If the specified persistent object is a null reference, a ArgumentNullException is thrown. If the current session already contains an object with the specified key value, the DifferentObjectsWithSameKeyException is thrown when committing changes to data store.

To get the value of a persistent object’s key property, use the Session.GetKeyValue method.

See Also