Skip to content
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

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

davidfowl
Copy link
Member

  • Added API to allows setting parameter policies in a linker friendly way
  • Added tests
  • Updated solution filter

Fixes #24723

- Added API to allows setting parameter policies in a linker friendly way
- Added tests
- Updated solution filter
@davidfowl
Copy link
Member Author

Feel free to review the words. I didn't put too much effort into it.

Copy link
Member

@javiercn javiercn left a 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]>
@davidfowl davidfowl enabled auto-merge (squash) November 2, 2021 17:10
@davidfowl davidfowl merged commit 2731ac7 into main Nov 2, 2021
@davidfowl davidfowl deleted the davidfowl/parameter-policies branch November 2, 2021 18:44
@ghost ghost added this to the 7.0-preview1 milestone Nov 2, 2021
@@ -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.")]
Copy link
Member

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?

Copy link
Member Author

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;
Copy link
Member

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?

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RouteConstraints aren't linker friendly
7 participants