Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
#46082 annotates Microsoft.AspNetCore.Http.Results
for trimming and AOT.
The route result methods have object
parameters that are turned into RouteValuesDictionary
. This is done with reflection and isn't safe with trimming.
Describe the solution you'd like
A couple of options:
- Add overloads that take
RouteValuesDictionary
. This is what we do withLinkGenerator
and in other places. - Add generic overloads with DAM attribute to keep everything.
- Experiments show that this could be a source-breaking change.
- Also, DAM attribute won't work with polymorphism. Reflection uses the type of the instance, while the DAM attribute won't preserve properties if the reference is typed as something else. e.g. a
Person
instance could be passed to the method asobject
, soPerson
properties aren't preserved.
Additional context
No response