ConventionTypeConfiguration.HasKey 方法 (IEnumerable<String>)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
為此實體類型設定主索引鍵屬性。
命名空間: System.Data.Entity.ModelConfiguration.Configuration
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
Public Function HasKey ( _
propertyNames As IEnumerable(Of String) _
) As ConventionTypeConfiguration
'用途
Dim instance As ConventionTypeConfiguration
Dim propertyNames As IEnumerable(Of String)
Dim returnValue As ConventionTypeConfiguration
returnValue = instance.HasKey(propertyNames)
public ConventionTypeConfiguration HasKey(
IEnumerable<string> propertyNames
)
public:
ConventionTypeConfiguration^ HasKey(
IEnumerable<String^>^ propertyNames
)
member HasKey :
propertyNames:IEnumerable<string> -> ConventionTypeConfiguration
public function HasKey(
propertyNames : IEnumerable<String>
) : ConventionTypeConfiguration
參數
- propertyNames
類型:System.Collections.Generic.IEnumerable<String>
要當做主索引鍵使用之屬性的名稱。
傳回值
類型:System.Data.Entity.ModelConfiguration.Configuration.ConventionTypeConfiguration
可以鏈結多個呼叫的相同 ConventionTypeConfiguration 執行個體。