Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataServiceKeyAttribute Class

Denotes the key property or properties of an entity.

System.Object
  System.Attribute
    System.Data.Services.Common.DataServiceKeyAttribute

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.

  NameDescription
Public methodDataServiceKeyAttribute(String)Initializes a new instance of the DataServiceKeyAttribute class.
Public methodDataServiceKeyAttribute(String[])Initializes a new instance of the DataServiceKeyAttribute class.
Top
  NameDescription
Public propertyKeyNamesGets the names of key attributes.
Public propertyTypeId (Inherited from Attribute.)
Top
  NameDescription
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.)
Top

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.
Show:
© 2014 Microsoft. All rights reserved.