IConventionPropertyBuilder.IsRequired(Nullable<Boolean>, Boolean) Yöntem

Tanım

Bu özelliğin atanmış bir değere sahip olması veya null geçerli bir değer olup olmayacağını yapılandırır. Bir özellik, yalnızca atanabilen bir CLR türünü temel alıyorsa, gerekli değildir olarak yapılandırılabilir null .

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder IsRequired (bool? required, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? IsRequired (bool? required, bool fromDataAnnotation = false);
abstract member IsRequired : Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function IsRequired (required As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

Parametreler

required
Nullable<Boolean>

Özelliğin gerekli olup olmadığını gösteren bir değer. null varsayılana sıfırlayın.

fromDataAnnotation
Boolean

Yapılandırmanın bir veri ek açıklaması kullanılarak mı belirtilmediğini belirtir.

Döndürülenler

IConventionPropertyBuilder

Gereksizlik yapılandırıldıysa aynı Oluşturucu örneği, null tersi durumda.

Şunlara uygulanır