Back to Devexpress

XPClassInfo.FindMember(String) Method

xpo-devexpress-dot-xpo-dot-metadata-dot-xpclassinfo-dot-findmember-x28-system-dot-string-x29.md

latest4.7 KB
Original Source

XPClassInfo.FindMember(String) Method

Returns information on the member with the specified name.

Namespace : DevExpress.Xpo.Metadata

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public XPMemberInfo FindMember(
    string memberName
)
vb
Public Function FindMember(
    memberName As String
) As XPMemberInfo

Parameters

NameTypeDescription
memberNameString

A String value which specifies the member’s name.

|

Returns

TypeDescription
XPMemberInfo

An XPMemberInfo object which represents member metadata. null ( Nothing in Visual Basic) if a member with the specified name isn’t found.

|

Remarks

The FindMember method scans the XPClassInfo.OwnMembers collection for an element whose XPMemberInfo.Name property’s value matches the memberName parameter. If an element with the specified name isn’t found, the FindMember method scans the XPClassInfo.OwnMembers collection of the base class (XPClassInfo.BaseClass).

The following code snippets (auto-collected from DevExpress Examples) contain references to the FindMember(String) 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-implement-odata4-service-with-xpo-netcore/CS/ODataService/Helpers/ApiHelper.cs#L35

csharp
var classInfo = uow.GetClassInfo<TEntity>();
var memberInfo = classInfo.FindMember(navigationProperty);
if(memberInfo == null) {

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

csharp
var classInfo = uow.GetClassInfo<TEntity>();
var memberInfo = classInfo.FindMember(navigationProperty);
if(memberInfo == null) {

XPO_how-to-persist-metadata-e269/CS/MetadataObjects.cs#L84

csharp
internal XPMemberInfo CreateMember(XPClassInfo owner) {
    XPMemberInfo result = owner.FindMember(Name);
    if(result == null)

XPO_how-to-dynamically-create-a-read-only-calculated-persistent-alias-property-e3473/CS/ConsoleApplication17/Program.cs#L33

csharp
System.Diagnostics.Debug.Assert(xpc[0].Name == "bbb");
XPMemberInfo mi = xpc[0].ClassInfo.FindMember("DisplayName");
System.Diagnostics.Debug.Assert(mi!= null && mi.IsReadOnly && mi.IsAliased);

XPO_how-to-persist-metadata-e269/VB/MetadataObjects.vb#L125

vb
Friend Function CreateMember(ByVal owner As XPClassInfo) As XPMemberInfo
    Dim result As XPMemberInfo = owner.FindMember(Name)
    If result Is Nothing Then result = CreateMemberCore(owner)

See Also

GetMember(String)

XPClassInfo Class

XPClassInfo Members

DevExpress.Xpo.Metadata Namespace