Skip to content

Override ToString for endpoint metadata #35231

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

Closed
wants to merge 3 commits into from

Conversation

Kahbazi
Copy link
Member

@Kahbazi Kahbazi commented Aug 10, 2021

Contributes to #34604

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Aug 10, 2021
@SteveSandersonMS
Copy link
Member

Question for the ASP.NET Core engineers: to what extent do you think the exact behavior of ToString should be considered supported and preserved for back-compat? Is there a risk that, in supplying this kind of info from ToString, we preclude ourselves from changing more things in the future (or possibly even just adding more info) because people might take a dependency on these exact string formats?

I know most of our types don't format and return internal state info from ToString, as we'd normally use DebuggerDisplay or similar for that.

@Pilchie Pilchie added area-blazor Includes: Blazor, Razor Components area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates area-runtime area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer labels Aug 11, 2021
@JamesNK
Copy link
Member

JamesNK commented Aug 11, 2021

I agree that DebuggerDisplay is the best place to add friendly text for debugging. The difference here is we need to capture the value at runtime.

The alternative, at least in this case, is adding an IEndpointDebugText like interface with a DebugText property and implementing it on all these types. I'm fine with using ToString here.

@BrennanConroy
Copy link
Member

Triage: Closing as the issue has been backlogged and needs some design, thank you for helping 😃

@Kahbazi Kahbazi deleted the kahbazi/MetadataToString branch September 20, 2021 20:36
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-auth Includes: Authn, Authz, OAuth, OIDC, Bearer area-blazor Includes: Blazor, Razor Components area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants