-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve linker friendliness for RouteOptions #38014
Conversation
- Added API to allows setting parameter policies in a linker friendly way - Added tests - Updated solution filter
Feel free to review the words. I didn't put too much effort into it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Javier Calvarro Nelson <[email protected]> Co-authored-by: Kahbazi <[email protected]>
Co-authored-by: Pranav K <[email protected]>
@@ -72,6 +72,7 @@ internal ICollection<EndpointDataSource> EndpointDataSources | |||
/// </summary> | |||
public IDictionary<string, Type> ConstraintMap | |||
{ | |||
[RequiresUnreferencedCode($"The linker cannot determine what constraints are being added via the ConstraintMap property. Prefer {nameof(RouteOptions)}.{nameof(SetParameterPolicy)} instead for setting constraints. This warning can be suppressed if this property is being used to read of delete constraints.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't say linker
in public facing docs/strings. Instead, we prefer the term trimmer
or trimming
.
is being used to read of delete constraints.
I'm not sure I understand what that means. Is there a type-o or missing word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah hah
@@ -72,6 +72,7 @@ internal ICollection<EndpointDataSource> EndpointDataSources | |||
/// </summary> | |||
public IDictionary<string, Type> ConstraintMap | |||
{ | |||
[RequiresUnreferencedCode($"The linker cannot determine what constraints are being added via the ConstraintMap property. Prefer {nameof(RouteOptions)}.{nameof(SetParameterPolicy)} instead for setting constraints. This warning can be suppressed if this property is being used to read of delete constraints.")] | |||
get | |||
{ | |||
return _constraintTypeMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you also need a RequiresUnreferencedCode
attribute on the setter?
Fixes #24723