diff --git a/src/AutoRest.CSharp/Common/Input/InputTypes/Serialization/TypeSpecReferenceHandler.cs b/src/AutoRest.CSharp/Common/Input/InputTypes/Serialization/TypeSpecReferenceHandler.cs index f9f04f21688..e06264e91b6 100644 --- a/src/AutoRest.CSharp/Common/Input/InputTypes/Serialization/TypeSpecReferenceHandler.cs +++ b/src/AutoRest.CSharp/Common/Input/InputTypes/Serialization/TypeSpecReferenceHandler.cs @@ -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}"); } } } diff --git a/src/AutoRest.CSharp/LowLevel/Output/LowLevelClient.cs b/src/AutoRest.CSharp/LowLevel/Output/LowLevelClient.cs index 710a265f6b2..a43890b9e29 100644 --- a/src/AutoRest.CSharp/LowLevel/Output/LowLevelClient.cs +++ b/src/AutoRest.CSharp/LowLevel/Output/LowLevelClient.cs @@ -277,7 +277,7 @@ public LowLevelSubClientFactoryMethod BuildFactoryMethod(ClientFields parentFiel ? subClientName[libraryName.Length..] : subClientName; - if (!IsResourceClient) + if (!IsResourceClient && !methodName.EndsWith(ClientBuilder.GetClientSuffix())) { methodName += ClientBuilder.GetClientSuffix(); }