Back to Aspnetcore

ASP0024: A route handler has multiple parameters with the [FromBody] attribute

aspnetcore/diagnostics/asp0024.md

latest962 B
Original Source

ASP0024: Route handler has multiple parameters with the [FromBody] attribute

Value
Rule IDASP0024
CategoryUsage
Fix is breaking or non-breakingNon-breaking

Cause

A route handler has multiple parameters with the [FromBody] attribute or a parameter with an [AsParameters] attribute where the parameter type contains multiple members with [FromBody] attributes.

Rule description

Route handler has multiple parameters with the [FromBody] attribute.

How to fix violations

To fix a violation of this rule, remove [FromBody] attributes from all but one parameter.

When to suppress warnings

Do not suppress a warning from this rule.