> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AL0023 - Unsupported form type

> [FromForm] can only bind primitives, primitive collections, or DTOs with specific constructor requirements

Source: [AL0020ToAL0024FormBindingAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/AL0020ToAL0024FormBindingAnalyzer.cs)

## Description

\[FromForm] can only bind primitives, primitive collections, or DTOs with a parameterless constructor or primary constructor with all-primitive parameters.

## Bad Code

```csharp theme={null}
([FromForm] ComplexService service) // has non-primitive constructor
```

## Good Code

```csharp theme={null}
([FromForm] UserDto user) // parameterless or primitive constructor
```

## Properties

* **Category**: ASP.NET Core
* **Severity**: Error
* **Enabled by default**: True
* **Code fix available**: False

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0023.severity = warning
```
