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資料註解

適用於