Back to Devexpress

XPMemberInfo.ReferenceType Property

xpo-devexpress-dot-xpo-dot-metadata-dot-xpmemberinfo-ddaff2f9.md

latest4.7 KB
Original Source

XPMemberInfo.ReferenceType Property

Gets the XPClassInfo of the referenced object if the member is a reference to another persistent object.

Namespace : DevExpress.Xpo.Metadata

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public virtual XPClassInfo ReferenceType { get; }
vb
Public Overridable ReadOnly Property ReferenceType As XPClassInfo

Property Value

TypeDescription
XPClassInfo

An XPClassInfo object which provides the metadata of the referenced object.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the ReferenceType property.

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-implement-odata4-service-with-xpo-netcore/CS/ODataService/Helpers/ApiHelper.cs#L44

csharp
collection.Add(reference);
} else if(memberInfo.ReferenceType != null) {
    var reference = uow.GetObjectByKey(memberInfo.ReferenceType, relatedKey);

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

csharp
collection.Add(reference);
} else if(memberInfo.ReferenceType != null) {
    var reference = uow.GetObjectByKey(memberInfo.ReferenceType, relatedKey);

XPO_how-to-get-a-list-of-a-persistent-objects-properties-e725/CS/Form1.cs#L115

csharp
result.Add(m.Name);
if(m.ReferenceType != null) {
    string[] childProps = GetObjectProperties(m.ReferenceType, processed);

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

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

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

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

XPO_how-to-get-a-list-of-a-persistent-objects-properties-e725/VB/Form1.vb#L113

vb
result.Add(m.Name)
If m.ReferenceType IsNot Nothing Then
    Dim childProps As String() = GetObjectProperties(m.ReferenceType, processed)

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

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

See Also

MemberType

XPMemberInfo Class

XPMemberInfo Members

DevExpress.Xpo.Metadata Namespace