From 852b30347b20e1ff2888511390671d267cef2d5b Mon Sep 17 00:00:00 2001 From: Youri970410 <62531040+Youri970410@users.noreply.github.com> Date: Tue, 2 Mar 2021 13:31:52 +0800 Subject: [PATCH] Fix issue for PVS-Studio (#14366) --- .../ApiManagement.ServiceManagement/ApiManagementClient.cs | 2 +- .../Commands/GetAzureApiManagementApiVersionSet.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs b/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs index 1ce9df0d69a2..605ba1a737ba 100644 --- a/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs +++ b/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs @@ -1194,7 +1194,7 @@ private string GetApiTypeForImport( } } - return apiType.HasValue ? apiType.Value.ToString("g") : PsApiManagementApiType.Http.ToString("g"); + return PsApiManagementApiType.Http.ToString("g"); } public void ApiAddToProduct(PsApiManagementContext context, string productId, string apiId) diff --git a/src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApiVersionSet.cs b/src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApiVersionSet.cs index 5700dffbfa1a..a52417731075 100644 --- a/src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApiVersionSet.cs +++ b/src/ApiManagement/ApiManagement.ServiceManagement/Commands/GetAzureApiManagementApiVersionSet.cs @@ -69,13 +69,13 @@ public override void ExecuteApiManagementCmdlet() apiVersionSetId = apiVersionSet.ApiVersionSetId; } - if (string.IsNullOrEmpty(ApiVersionSetId)) + if (string.IsNullOrEmpty(apiVersionSetId)) { WriteObject(Client.GetApiVersionSets(resourceGroupName, serviceName), true); } else { - WriteObject(Client.GetApiVersionSet(resourceGroupName, serviceName, ApiVersionSetId)); + WriteObject(Client.GetApiVersionSet(resourceGroupName, serviceName, apiVersionSetId)); } } }