expressappframework-devexpress-dot-persistent-dot-base-b66ff044.md
Specifies the property which is considered an analog of the GUID property, to allow use of more suitable values.
Namespace : DevExpress.Persistent.Base
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
public class FriendlyKeyPropertyAttribute :
Attribute
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface)>
Public Class FriendlyKeyPropertyAttribute
Inherits Attribute
Normally, business classes have a persistent property which represents an identifier. This identifier is usually more suitable than a GUID. To inform the system of these identifier-like properties, apply the FriendlyKeyProperty attribute to a business class, and pass the identifier-like property as the FriendlyKeyPropertyAttribute.MemberName parameter. In XAF applications, the properties that use that attribute are involved in the following:
The name of the property passed as the FriendlyKeyProperty attribute’s parameter is set for the IModelClass.FriendlyKeyProperty property of the Application Model‘s BOModel | <Class> node.
Note
To add a column that corresponds to an identifier-like property to a Lookup List View, apply the FriendlyKey attribute in code.
In the example below, the FriendlyKeyProperty attribute is applied to the Contact class. As a result, the FullName property is considered as an identifier by the system.
[FriendlyKeyProperty(nameof(FullName))]
public class Contact : Person {
//...
}
Object Attribute FriendlyKeyPropertyAttribute
See Also