Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit e77dcb3

Browse files
committed
refactor logic
1 parent a1381a5 commit e77dcb3

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/APIM_ARMTemplate/apimtemplate/Commands/Extract.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,17 +362,10 @@ private void GenerateProductsARMTemplate(string apimname, string resourceGroup,
362362
productsDetailsResource.name = $"[concat(parameters('ApimServiceName'), '/{productName}')]";
363363
productsDetailsResource.apiVersion = "2018-06-01-preview";
364364

365-
if (singleApiName == null)
365+
// only extract the product if this is a full extraction, or in the case of a single api, if it is found in productNames(all prodct names associated with the specific api)
366+
if (singleApiName == null || productNames.SingleOrDefault(p => p == productName) != null)
366367
{
367368
templateResources.Add(productsDetailsResource);
368-
} else
369-
{
370-
// utility is extracting a single api, only extract the product if it is found in productNames (all prodct names associated with the specific api)
371-
if (productNames.SingleOrDefault(p => p == productName) != null)
372-
{
373-
// current product is indeed associated with the api
374-
templateResources.Add(productsDetailsResource);
375-
}
376369
}
377370
}
378371

src/APIM_ARMTemplate/apimtemplate/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"apimtemplate": {
44
"commandName": "Project",
5-
"commandLineArgs": "extract --name apiphany --resourceGroup vlvinogr-apim --fileFolder C:\\Users\\lucashh\\Desktop\\Projects\\APIM-ARM\\ExtractedTemplates\\Full"
5+
"commandLineArgs": "extract --name apiphany --resourceGroup vlvinogr-apim --fileFolder C:\\Users\\lucashh\\Desktop\\Projects\\APIM-ARM\\ExtractedTemplates\\SingleAPI --apiName http-bin-dot-org"
66
}
77
}
88
}

0 commit comments

Comments
 (0)