Skip to main content
A newer version of this page is available. .

XPMemberInfo.MappingField Property

Gets the column’s name in the data store which the member’s value is stored in.

Namespace: DevExpress.Xpo.Metadata

Assembly: DevExpress.Xpo.v21.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public string MappingField { get; }

Property Value

Type Description
String

A String value that specifies the column’s name in the data store which the member’s value is stored in.

Remarks

Use the MappingField property to obtain the name of the column in the data store which the member’s data is stored in.

By default, the MappingField property returns the member’s name. Use the PersistentAttribute to specify the name of a field in the data store to map to.

Example

The following example shows how to use the PersistentAliasAttribute to implement a public read-only property exposing a value of the private persistent property. The expression passed in the PersistentAliasAttribute class constructor specifies the name of the field which stores the value at runtime. The field is decorated with the PersistentAttribute whose PersistentAttribute.MapTo property holds the name of the data store column where the field’s value is stored.

using DevExpress.Xpo;

// ...
[Persistent("DefaultAddress")]
private string mDefaultAddress;

[PersistentAlias(nameof(mDefaultAddress))]
public string DefaultAddress {
    get {
        return mDefaultAddress;
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MappingField 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.

See Also