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해야 합니다.

적용 대상