aspnetcore
aspnetcore copied to clipboard
Descriptive Error for Improper Use of [AsParameters]
Descriptive Error for Improper Use of [AsParameters]
Description
-
Throw NotSupportedException if [AsParameters] is applied to an enumerable class.
-
Preserve existing behavior for collections that are also abstract classes, like IFormCollection. In order to do this, a dedicated unit test was added.
Fixes #56114
Converting draft to PR despite some failing tests in Interop.FunctionalTests.
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/41074")] [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/39985")]
Justification:
Seems like those tests failed with no regard to my changes. Also, tests are failing for the main branch. Also, I spotted merged PR's with failed tests in this area.
FYI @captainsafia
/azp run
Commenter does not have sufficient privileges for PR 58218 in repo dotnet/aspnetcore
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
@smnsht Thanks for changing the code here!
I also realized that similar to the other PR you're working on, we'll need to add checks in the RDG implementation for this. Here is the code that needs to be modified in the source generator. Instead of throwing there, we emit diagnostics when the type is invalid.
@captainsafia
I also realized that similar to the other PR you're working on, we'll need to add checks in the RDG implementation for this. Here is the code that needs to be modified in the source generator. Instead of throwing there, we emit diagnostics when the type is invalid.
Done
/azp run
Azure Pipelines successfully started running 3 pipeline(s).