Windows apps
Collapse the table of content
Expand the table of content

DataServiceKeyAttribute Class

Denotes the key property or properties of an entity.


Namespace:  System.Data.Services.Common
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)

[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)]
public sealed class DataServiceKeyAttribute : Attribute

The DataServiceKeyAttribute type exposes the following members.

Public methodDataServiceKeyAttribute(String)Initializes a new instance of the DataServiceKeyAttribute class.
Public methodDataServiceKeyAttribute(String[])Initializes a new instance of the DataServiceKeyAttribute class.

Public propertyKeyNamesGets the names of key attributes.
Public propertyTypeId (Inherited from Attribute.)

Public methodEquals (Inherited from Attribute.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Public methodToString (Inherited from Object.)

You should only apply the DataServiceKeyAttribute attribute to a property that can be used to uniquely identify an instance of the entity type. This attribute is ignored when applied to a navigation property. For more information, see Reflection Provider (WCF Data Services).

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