[MaxArraySize]

Attribute used for limiting the maximum number of elements in an array or list.

Support Types

Type
Example
Description

T[]

string[]

Default C# array

List<T>

List<string>

Collection generic List

!!! info "Info" Where T is type of array elements.

Parameters

Parameter Name
Description

size

Maximum allowed number of elements.

Examples

[MaxArraySize(5)]
public int[] values;

[MaxArraySize(10)]
public List<string> names;

Last updated