ForeignKeyAttribute(String) 建構函式

定義

初始化 ForeignKeyAttribute 類別的新執行個體。

public:
 ForeignKeyAttribute(System::String ^ name);
public ForeignKeyAttribute (string name);
new System.ComponentModel.DataAnnotations.Schema.ForeignKeyAttribute : string -> System.ComponentModel.DataAnnotations.Schema.ForeignKeyAttribute
Public Sub New (name As String)

參數

name
String

關聯的導覽屬性名稱,或一或多個關聯的外部索引鍵名稱。

備註

如果您將 ForeignKey 屬性新增至外鍵屬性, name 則應該指定相關聯導覽屬性的名稱。 如果您將 ForeignKey 屬性新增至導覽屬性, name 應該指定一或多個相關聯的外鍵名稱。 如果導覽屬性有多個外鍵,請使用逗號分隔外鍵名稱清單。 如需詳細資訊,請參閱 Code First 數據批注

適用於