-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
NativeAOTlinker-friendlinessTracking linker friendlinessTracking linker friendlinessold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
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 withLinkGeneratorand 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
Personinstance could be passed to the method asobject, soPersonproperties aren't preserved.
Additional context
No response
Metadata
Metadata
Assignees
Labels
NativeAOTlinker-friendlinessTracking linker friendlinessTracking linker friendlinessold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels