IConventionEntityTypeBuilder.CreateUniqueProperty 方法

定義

建立名稱與任何現有屬性不同的屬性。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder CreateUniqueProperty (Type propertyType, string basePropertyName, bool required);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? CreateUniqueProperty (Type propertyType, string basePropertyName, bool required);
abstract member CreateUniqueProperty : Type * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function CreateUniqueProperty (propertyType As Type, basePropertyName As String, required As Boolean) As IConventionPropertyBuilder

參數

propertyType
Type

屬性將保留的數值型別。

basePropertyName
String

所需的屬性名稱。

required
Boolean

值,指出是否需要 屬性。

傳回

物件,如果屬性存在於實體類型上,則可用來設定屬性, null 否則為 。

適用於