Back to Devexpress

XPMemberInfo.GetValue(Object) Method

xpo-devexpress-dot-xpo-dot-metadata-dot-xpmemberinfo-dot-getvalue-x28-system-dot-object-x29.md

latest5.0 KB
Original Source

XPMemberInfo.GetValue(Object) Method

When implemented in a derived class, returns the property’s value.

Namespace : DevExpress.Xpo.Metadata

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public abstract object GetValue(
    object theObject
)
vb
Public MustOverride Function GetValue(
    theObject As Object
) As Object

Parameters

NameTypeDescription
theObjectObject

An object whose value will be returned.

|

Returns

TypeDescription
Object

An object which represents the property’s value.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetValue(Object) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XPO_how-to-clone-a-persistent-object-e804/CS/SimpleObject/CloneHelper.cs#L53

csharp
if (memberInfo.ReferenceType != null) {
    object value = memberInfo.GetValue(source);
    if (value != null) {

xaf-how-to-use-the-file-attachment-module-with-a-legacy-database/CS/CustomFileDataSolution.Module/BusinessObjects/InplaceFileData.cs#L30

csharp
get {
    if (member.GetValue(host) == null) return null;
    return string.Format("{0}{1}.{2}", member.Name, member.Owner.GetId(host), extension);

XPO_how-to-implement-odata4-service-with-xpo-netcore/CS/ODataService/Helpers/ApiHelper.cs#L42

csharp
var reference = uow.GetObjectByKey(memberInfo.CollectionElementType, relatedKey);
var collection = (IList)memberInfo.GetValue(entity);
collection.Add(reference);

XPO_how-to-implement-odata4-service-with-xpo/CS/ODataService/Helpers/ApiHelper.cs#L51

csharp
var reference = uow.GetObjectByKey(memberInfo.CollectionElementType, relatedKey);
var collection = (IList)memberInfo.GetValue(entity);
collection.Add(reference);

xpo-json-serialization/CS/XpoSerialization/JsonConverters.cs#L25

csharp
writer.WritePropertyName(member.Name);
object propertyValue = member.GetValue(theObject);
if(propertyValue != null && member.ReferenceType != null && !member.IsAggregated && !EvaluatorProperty.GetIsThisProperty(member.Name)) {

XPO_how-to-clone-a-persistent-object-e804/VB/SimpleObject/CloneHelper.vb#L56

vb
If memberInfo.ReferenceType IsNot Nothing Then
    Dim value As Object = memberInfo.GetValue(source)
    If value IsNot Nothing Then

xaf-how-to-use-the-file-attachment-module-with-a-legacy-database/VB/CustomFileDataSolution.Module/BusinessObjects/InplaceFileData.vb#L32

vb
Get
    If member.GetValue(host) Is Nothing Then
        Return Nothing

See Also

SetValue(Object, Object)

XPMemberInfo Class

XPMemberInfo Members

DevExpress.Xpo.Metadata Namespace