Skip to main content
.NET 6.0+

Session.SetKeyValue(Object, Object) Method

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

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

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