Sprache

IConventionForeignKey.SetIsRequired(Nullable<Boolean>, Boolean) Methode

Definition

Legt einen Wert fest, der angibt, ob die Prinzipalentität erforderlich ist. Wenn truedie abhängige Entität immer einer gültigen Prinzipalentität zugewiesen werden muss.

public bool? SetIsRequired(bool? required, bool fromDataAnnotation = false);
public void SetIsRequired(bool? required, bool fromDataAnnotation = false);
abstract member SetIsRequired : Nullable<bool> * bool -> Nullable<bool>
abstract member SetIsRequired : Nullable<bool> * bool -> unit
Public Function SetIsRequired (required As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false) As Nullable(Of Boolean)
Public Sub SetIsRequired (required As Nullable(Of Boolean), Optional fromDataAnnotation As Boolean = false)

Parameter

required
Nullable<Boolean>

Ein Wert, der angibt, ob die Prinzipalentität erforderlich ist.

fromDataAnnotation
Boolean

Gibt an, ob die Konfiguration mithilfe einer Datenanmerkung angegeben wurde.

Gibt zurück

Die konfigurierte Erforderliche.

Gilt für: