ConventionPrimitivePropertyConfiguration.IsRequired 方法
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
將此屬性設定為 required。 用來儲存此屬性的資料庫資料行將不會是 nullable。
命名空間: System.Data.Entity.ModelConfiguration.Configuration
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
Public Overridable Function IsRequired As ConventionPrimitivePropertyConfiguration
'用途
Dim instance As ConventionPrimitivePropertyConfiguration
Dim returnValue As ConventionPrimitivePropertyConfiguration
returnValue = instance.IsRequired()
public virtual ConventionPrimitivePropertyConfiguration IsRequired()
public:
virtual ConventionPrimitivePropertyConfiguration^ IsRequired()
abstract IsRequired : unit -> ConventionPrimitivePropertyConfiguration
override IsRequired : unit -> ConventionPrimitivePropertyConfiguration
public function IsRequired() : ConventionPrimitivePropertyConfiguration
傳回值
類型:System.Data.Entity.ModelConfiguration.Configuration.ConventionPrimitivePropertyConfiguration
可以鏈結多個呼叫的相同 ConventionPrimitivePropertyConfiguration 執行個體。
備註
一旦設定後,呼叫它會沒有作用。