In ASP.NET 7, IEnumerable<> controller parameters do not bind from request body by default #45162
Closed
1 task done
Labels
bug
This issue describes a behavior which is not expected - a bug.
feature-model-binding
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Is there an existing issue for this?
Describe the bug
In ASP.NET 7, a controller with an
IEnumerable<>
parameter is not bound from the body of the request by default. An empty array is seen by the controller. This worked in ASP.NET 6.If the
[FromBody]
attribute is added to the parameter orList<>
is used instead, the binding works. The linked GitHub project demonstrates this.Expected Behavior
An
IEnumerable<>
parameter should be bound from the body by default, as it was in ASP.NET 6.Steps To Reproduce
https://github.com/0x03BB/ParameterBindingIssue
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
Using Visual Studio 17.4.1
dotnet info.txt
The text was updated successfully, but these errors were encountered: