Share via


KeyAttribute Class

Important

This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.

Used to mark one or more entity properties that provide the entity's unique identity.

Namespace:  Microsoft.Dynamics.Commerce.Runtime.ComponentModel.DataAnnotations
Assembly:  Microsoft.Dynamics.Commerce.Runtime.Framework (in Microsoft.Dynamics.Commerce.Runtime.Framework.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple := False,  _
    Inherited := True)> _
Public NotInheritable Class KeyAttribute _
    Inherits Attribute
'Usage
Dim instance As KeyAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, 
    Inherited = true)]
public sealed class KeyAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Field, AllowMultiple = false, 
    Inherited = true)]
public ref class KeyAttribute sealed : public Attribute

Inheritance Hierarchy

System.Object
  System.Attribute
    Microsoft.Dynamics.Commerce.Runtime.ComponentModel.DataAnnotations.KeyAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Dynamics.Commerce.Runtime.ComponentModel.DataAnnotations Namespace