RequiredAttribute.AllowEmptyStrings プロパティ

定義

空の文字列が許可されるかどうかを示す値を取得または設定します。

public:
 property bool AllowEmptyStrings { bool get(); void set(bool value); };
public bool AllowEmptyStrings { get; set; }
member this.AllowEmptyStrings : bool with get, set
Public Property AllowEmptyStrings As Boolean

プロパティ値

true 空の文字列が許可されている場合。それ以外の場合は false。 既定値は false です。

注釈

AllowEmptyStringsをデータ フィールドのtrueに設定すると、動的データは検証を実行せず、空の文字列をnull値に変換します。 この値は、データベースに渡されます。

データベースで null 値が許可されていない場合は、エラーが発生します。 このエラーを回避するには、 ConvertEmptyStringToNullfalseに設定する必要もあります。

適用対象