Inconsistent model binding between IFormFileCollection
, IReadOnlyList<IFormFile>
and other collection types in Minimal APIs
#54999
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
Docs
This issue tracks updating documentation
Milestone
Is there an existing issue for this?
Describe the bug
Minimal API form binding works differently based on which interface types you choose to use:
IFormFileCollection
binds every file regardless of their name.IReadOnlyList<IFormFile>
binds all the ones with the corresponding names.IFormFileCollection
did.IEnumerable<IFormFile>
,IReadOnlyCollection<IFormFile>
,IList<IFormFile>
, andICollection<IFormFile>
) and their implementations (List<IFormFile>
,IFormFile[]
,Collection<IFormFile>
, andReadOnlyCollection<IFormFile>
) do not work at all.Expected Behavior
IFormFileCollection
respects the name of the property.Steps To Reproduce
https://github.com/KennethHoff/Repros/tree/master/AspNetCoreMinimalApiInconsistentFormFileCollectionModelBinding
Exceptions (if any)
No response
.NET Version
8.0.202
Anything else?
I realize this is a (huge?) breaking change and this issue will therefore probably never be dealt with, but if nothing else I hope I'll save another developer some time in the future.
The only "documentation" I found of this behaviour is this comment thread on a Pull Request from last year.
The text was updated successfully, but these errors were encountered: