Skip to content

Commit

Permalink
Don't append Client suffix when the name endwith client already (#5007)
Browse files Browse the repository at this point in the history
  • Loading branch information
chunyu3 authored Aug 27, 2024
1 parent d2c7e37 commit df42f8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override string GetReference(object value, out bool alreadyExists)
=> throw new InvalidOperationException("JSON writing isn't supported");

public override object ResolveReference(string referenceId)
=> _referenceIdToObjectMap.TryGetValue(referenceId, out object? value) ? value : throw new JsonException();
=> _referenceIdToObjectMap.TryGetValue(referenceId, out object? value) ? value : throw new JsonException($"Cannot resolve reference {referenceId}");
}
}
}
2 changes: 1 addition & 1 deletion src/AutoRest.CSharp/LowLevel/Output/LowLevelClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public LowLevelSubClientFactoryMethod BuildFactoryMethod(ClientFields parentFiel
? subClientName[libraryName.Length..]
: subClientName;

if (!IsResourceClient)
if (!IsResourceClient && !methodName.EndsWith(ClientBuilder.GetClientSuffix()))
{
methodName += ClientBuilder.GetClientSuffix();
}
Expand Down

0 comments on commit df42f8c

Please sign in to comment.