Skip to content

Commit 238c748

Browse files
Update eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Utilities/ResourceHelpers.cs
Co-authored-by: Copilot <[email protected]>
1 parent 1bf1fe6 commit 238c748

File tree

1 file changed

+1
-1
lines changed
  • eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Utilities

1 file changed

+1
-1
lines changed

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Utilities/ResourceHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static string GetRestClientPropertyName(string clientName)
6363

6464
public static string GetDiagnosticScope(TypeProvider enclosingType, string methodName, bool isAsync)
6565
{
66-
var rawMethodName = isAsync ? methodName.Substring(0, methodName.Length - 5) : methodName; // trim "Async" if the method is async method
66+
var rawMethodName = isAsync && methodName.EndsWith("Async") ? methodName[..^5] : methodName; // trim "Async" if the method is async method
6767
return $"{enclosingType.Type.Name}.{rawMethodName}";
6868
}
6969

0 commit comments

Comments
 (0)