-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
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.- Prior to noticing this issue I always used this type if I wanted to get a collection of files, as it seemed like the obvious one based on the name.
IReadOnlyList<IFormFile>
binds all the ones with the corresponding names.- This is what I thought
IFormFileCollection
did.
- This is what I thought
- All the other collection interfaces (
IEnumerable<IFormFile>
,IReadOnlyCollection<IFormFile>
,IList<IFormFile>
, andICollection<IFormFile>
) and their implementations (List<IFormFile>
,IFormFile[]
,Collection<IFormFile>
, andReadOnlyCollection<IFormFile>
) do not work at all.- This is fine for my use-case, just wanted to mention it for completeness sake.
Expected Behavior
IFormFileCollection
respects the name of the property.
Steps To Reproduce
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.
Metadata
Metadata
Assignees
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etc