diff --git a/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs b/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs
index bfc1a8228bc..387fc450e52 100644
--- a/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs
+++ b/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs
@@ -31,7 +31,7 @@ private static AvailabilitySetsRestOperations GetAvailabilitySetsRestOperations(
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListAvailabilitySetAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetAvailabilitySetsRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
@@ -180,7 +180,7 @@ private static ProximityPlacementGroupsRestOperations GetProximityPlacementGroup
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListProximityPlacementGroupAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetProximityPlacementGroupsRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
@@ -327,7 +327,7 @@ private static DedicatedHostGroupsRestOperations GetDedicatedHostGroupsRestOpera
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListDedicatedHostGroupAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetDedicatedHostGroupsRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
@@ -474,7 +474,7 @@ private static SshPublicKeysRestOperations GetSshPublicKeysRestOperations(Client
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListSshPublicKeyAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetSshPublicKeysRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
@@ -621,7 +621,7 @@ private static VirtualMachinesRestOperations GetVirtualMachinesRestOperations(Cl
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListVirtualMachineAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetVirtualMachinesRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
@@ -770,7 +770,7 @@ private static VirtualMachineScaleSetsRestOperations GetVirtualMachineScaleSetsR
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListVirtualMachineScaleSetAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetVirtualMachineScaleSetsRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
diff --git a/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs b/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs
index 731d3d93d25..3c8a20e5915 100644
--- a/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs
+++ b/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs
@@ -171,7 +171,7 @@ private void WriteListResourceMethod(CodeWriter writer, Resource resource, Resou
var methodName = $"List{resource.Type.Name}";
using (writer.Scope($"public static {responseType} {CreateMethodName(methodName, async)}(this {typeof(SubscriptionOperations)} subscription, {typeof(CancellationToken)} cancellationToken = default)"))
{
- writer.Append($"return subscription.ListResources((baseUri, credential, options, pipeline) =>");
+ writer.Append($"return subscription.{CreateMethodName("ListResources", async)}((baseUri, credential, options, pipeline) =>");
using (writer.Scope())
{
var clientDiagnostics = new CodeWriterDeclaration("clientDiagnostics");
diff --git a/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs b/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs
index 28dfb24e18d..0d229b0a0f0 100644
--- a/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs
+++ b/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs
@@ -31,7 +31,7 @@ private static AvailabilitySetsRestOperations GetAvailabilitySetsRestOperations(
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListAvailabilitySetAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetAvailabilitySetsRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);
diff --git a/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs b/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs
index ec4d75cc542..93cba48693d 100644
--- a/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs
+++ b/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs
@@ -41,7 +41,7 @@ private static OvensRestOperations GetOvensRestOperations(ClientDiagnostics clie
/// A collection of resource operations that may take multiple service requests to iterate over.
public static AsyncPageable ListOvenAsync(this SubscriptionOperations subscription, CancellationToken cancellationToken = default)
{
- return subscription.ListResources((baseUri, credential, options, pipeline) =>
+ return subscription.ListResourcesAsync((baseUri, credential, options, pipeline) =>
{
var clientDiagnostics = new ClientDiagnostics(options);
var restOperations = GetOvensRestOperations(clientDiagnostics, credential, options, pipeline, subscription.Id.SubscriptionId, baseUri);