Skip to content

.NET 10 Preview 1#1161

Merged
commonsensesoftware merged 34 commits intomainfrom
dev/css/v10
Feb 16, 2026
Merged

.NET 10 Preview 1#1161
commonsensesoftware merged 34 commits intomainfrom
dev/css/v10

Conversation

@commonsensesoftware
Copy link
Collaborator

.NET 10 Preview 1

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Contains the baseline set of changes for the .NET 10 - Preview 1 release.

…edApiVersionDescriptionProvider and remove it
… Where applicable, update extension methods to extension properties.
…ed and emit policy links in the x-api-versioning extension.
else
{
markdown.Append( "- [" )
.Append( link.Title.ToString() )

Check notice

Code scanning / CodeQL

Redundant ToString() call Note

Redundant call to 'ToString' on a String object.

Copilot Autofix

AI 15 days ago

In general, to fix redundant ToString() calls in string concatenation or StringBuilder usage, you can either (a) pass the original object to APIs that already call ToString() internally, or (b) ensure you pass a string directly when the source is already a string. Here, link.Title is a StringSegment, and StringSegment has an implicit conversion to string. The best fix is to remove the explicit .ToString() and rely on that implicit conversion, which keeps behavior the same but avoids an unnecessary explicit call and satisfies the analyzer.

Concretely, in src/AspNetCore/WebApi/src/Asp.Versioning.OpenApi/Transformers/ApiExplorerTransformer.cs, within the RenderLink method, change line 245 from .Append( link.Title.ToString() ) to .Append( (string) link.Title ). This makes it explicit that a string is being appended while avoiding the redundant ToString() call. No new methods or imports are needed; we only adjust that single call site.

Suggested changeset 1
src/AspNetCore/WebApi/src/Asp.Versioning.OpenApi/Transformers/ApiExplorerTransformer.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/AspNetCore/WebApi/src/Asp.Versioning.OpenApi/Transformers/ApiExplorerTransformer.cs b/src/AspNetCore/WebApi/src/Asp.Versioning.OpenApi/Transformers/ApiExplorerTransformer.cs
--- a/src/AspNetCore/WebApi/src/Asp.Versioning.OpenApi/Transformers/ApiExplorerTransformer.cs
+++ b/src/AspNetCore/WebApi/src/Asp.Versioning.OpenApi/Transformers/ApiExplorerTransformer.cs
@@ -242,7 +242,7 @@
         else
         {
             markdown.Append( "- [" )
-                    .Append( link.Title.ToString() )
+                    .Append( (string) link.Title )
                     .Append( "](" )
                     .Append( link.LinkTarget.OriginalString )
                     .Append( ')' );
EOF
@@ -242,7 +242,7 @@
else
{
markdown.Append( "- [" )
.Append( link.Title.ToString() )
.Append( (string) link.Title )
.Append( "](" )
.Append( link.LinkTarget.OriginalString )
.Append( ')' );
Copilot is powered by AI and may make mistakes. Always verify output.
@commonsensesoftware commonsensesoftware merged commit 2e9e4ca into main Feb 16, 2026
6 checks passed
@commonsensesoftware commonsensesoftware deleted the dev/css/v10 branch February 16, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant