Export (0) Print
Expand All

ForeignKeyAttribute Class

Denotes a property used as a foreign key in a relationship. The annotation may be placed on the foreign key property and specify the associated navigation property name, or placed on a navigation property and specify the associated foreign key name.

System.Object
  System.Attribute
    System.ComponentModel.DataAnnotations.ForeignKeyAttribute

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  EntityFramework (in EntityFramework.dll)

[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public class ForeignKeyAttribute : Attribute

The ForeignKeyAttribute type exposes the following members.

  NameDescription
Public methodForeignKeyAttribute Initializes a new instance of the ForeignKeyAttribute class.
Top

  NameDescription
Public propertyName If placed on a foreign key property, the name of the associated navigation property. If placed on a navigation property, the name of the associated foreign key(s).
Public propertyTypeId (Inherited from Attribute.)
Top

  NameDescription
Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate method_Attribute.GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.Invoke (Inherited from Attribute.)
Top

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