> ## 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.

# AL0024 - Form and body conflict

> Mixing [FromForm] and [FromBody] parameters in the same endpoint is not supported

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

## Description

An HTTP request body can only be consumed once. Mixing \[FromForm] and \[FromBody] parameters in the same endpoint is not supported.

## Bad Code

```csharp theme={null}
([FromForm] UserDto user, [FromBody] string json)
```

## Good Code

```csharp theme={null}
([FromForm] UserDto user) // use one or the other
```

## Properties

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

## Configuration

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