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입니다.

설명

데이터 필드로 true 설정 AllowEmptyStrings 하면 동적 데이터가 유효성 검사를 수행하지 않고 빈 문자열을 값으로 null 변환합니다. 이 값은 데이터베이스에 전달됩니다.

데이터베이스에서 값을 허용하지 null 않으면 오류가 발생합니다. 이 오류를 방지하려면 다음으로 설정 ConvertEmptyStringToNullfalse해야 합니다.

적용 대상