[NotEmpty]

Attribute used for displaying a warning when a string or collection field is empty.

Support Types

Type
Example
Description

string

string

String fields

ICollection

Array, List<T>

Collection types

Parameters

Parameter Name
Arguments
Description

Format

string

Custom message format. Use {name} as placeholder for field name.

Height

float

Height of the help box in pixels.

Style

MessageStyle

Icon style of the warning message.

Examples

[NotEmpty]
public string requiredString;

[NotEmpty(Format = "Please add at least one item to {name}")]
public List<string> requiredList;

[NotEmpty(Style = MessageStyle.Warning)]
public int[] requiredArray;

Last updated