Skip to content

feat(http-client-csharp): add ParameterProvider.Invoke overload accepting extensionType#10538

Open
JoshLove-msft wants to merge 2 commits intomicrosoft:mainfrom
JoshLove-msft:add-invoke-extensiontype-overload
Open

feat(http-client-csharp): add ParameterProvider.Invoke overload accepting extensionType#10538
JoshLove-msft wants to merge 2 commits intomicrosoft:mainfrom
JoshLove-msft:add-invoke-extensiontype-overload

Conversation

@JoshLove-msft
Copy link
Copy Markdown
Contributor

Adds an overload of Invoke(this ParameterProvider, string, IReadOnlyList<ValueExpression>, IReadOnlyList<CSharpType>, CSharpType?) to Microsoft.TypeSpec.Generator.Snippets.Snippet so downstream emitters can construct an InvokeMethodExpression with ExtensionType set in a single expression instead of constructing it and then calling Update(extensionType: …).

Motivated by Azure/azure-sdk-for-net#58615 (review), where ClientHostExtensionsDefinition currently has to do:

var invoke = hostParam.Invoke(targetMethodName, args, typeArgs);
invoke.Update(extensionType: ConfigurationExtensionsType);

After this change it can be:

var invoke = hostParam.Invoke(targetMethodName, args, typeArgs, ConfigurationExtensionsType);

The existing 4-arg overload is preserved as-is for source compatibility.

…ting extensionType

Adds an overload of Invoke(this ParameterProvider, string, IReadOnlyList<ValueExpression>, IReadOnlyList<CSharpType>, CSharpType?) so callers in downstream emitters (e.g. Azure.Generator) can construct an InvokeMethodExpression with ExtensionType set in a single expression instead of constructing it and then calling Update(extensionType: ...). The existing 4-arg overload is preserved for source compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Apr 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 29, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@10538

commit: d6a8d54

@github-actions
Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@azure-sdk
Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants