Skip to main content

XPMemberInfo.GetOldValue(Object) Method

Returns the old value of the member.

Namespace: DevExpress.Xpo.Metadata

Assembly: DevExpress.Xpo.v24.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public abstract object GetOldValue(
    object theObject
)

Parameters

Name Type Description
theObject Object

A persistent object for which the member value will be obtained.

Returns

Type Description
Object

An object which is the old value of the member.

Remarks

XPMemberInfo member = customer.ClassInfo.GetMember(propertyName);
string memberValue;
if(member.GetModified(customer)) {
  memberValue = string.Format("{0} (old value: {1})", member.GetValue(customer), member.GetOldValue(customer));
} 
else {
  memberValue = (string)member.GetValue(customer);
}

For more information, refer to the %PUBLIC%\Documents\DevExpress Demos 24.1\Components\WinForms\CS\XpoTutorials\ModifiedProperties\ModifiedProperties.cs file.

See Also