Skip to content

Commit d6c955b

Browse files
haiyuazhangCopilot
andauthored
fix bug in PopulateArguments. (#50954)
* fix bug in PopulateArguments. * refine. * Update eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/ResourceClientProvider.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3bed27a commit d6c955b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/ResourceClientProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public ValueExpression[] PopulateArguments(
357357
}
358358
// TODO: handle parents
359359
// Handle resource name - the last contextual parameter
360-
else if (parameter.Name.Equals(ContextualParameters.Last(), StringComparison.InvariantCultureIgnoreCase))
360+
else if (ContextualParameters.Any() && parameter.Name.Equals(ContextualParameters.Last(), StringComparison.InvariantCultureIgnoreCase))
361361
{
362362
arguments.Add(
363363
This.Property(nameof(ArmResource.Id)).Property(nameof(ResourceIdentifier.Name)));

0 commit comments

Comments
 (0)