Skip to content

Field Types

Type Inference

The extension attempts to automatically infer the appropriate field type for each property. You can also override the type manually by setting [FieldType(FieldType)] on the property.

Enums

Enums are rendered as a <select> element, with the enum name as the display label and the underlying numeric value as the option value.

Reference Types

Reference type properties need [ValueSource(string)] to work properly. See foreign keys.

Reference types will be rendered as a <select> with the Id as the value and ToString() as the displayed name.

Lists

List properties need [ValueSource(string)] to work properly. See foreign keys.

Lists will be rendered as a <select multiple> with the Id as the value and ToString() as the displayed name.

Supported Types

Text

Automatic for types: string

Rendered as <input type="text">

Password

Must be specified manually

Rendered as <input type="password">

Number

Automatic for types: int, float, double, long, short, decimal

Rendered as <input type="number">

Date

Automatic for types: DateTime, DateTimeOffset

Rendered as <input type="date">

Select

Automatic for reference types, see above.

MultiSelect

Automatic for List<>, see above.

TextArea

Must be specified manually.

Rendered as <textarea>

Checkbox

Must be specified manually.

Radio

Must be specified manually, works the same way as Select

Color

Must be specified manually.

Rendered as <input type="color">