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

Commit 597888f

Browse files
bremnesRupengLiu
andcommitted
Adjusted tag filter to be more accurate. (#327)
Co-authored-by: RupengLiu <[email protected]>
1 parent b57230d commit 597888f

File tree

1 file changed

+7
-7
lines changed
  • src/APIM_ARMTemplate/apimtemplate/Extractor/EntityExtractors

1 file changed

+7
-7
lines changed

src/APIM_ARMTemplate/apimtemplate/Extractor/EntityExtractors/TagExtractor.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ public async Task<Template> GenerateTagsTemplateAsync(string apimname, string re
6060
// or if it is found in tags associated with the api
6161
// or if it is found in tags associated with the products associated with the api
6262
if (singleApiName == null
63-
|| apiOperationTagResources.FirstOrDefault(t => t.name.Contains($"/{TagName}")) != null
64-
|| apiTagResources.FirstOrDefault(t => t.name.Contains($"/{TagName}")) != null
65-
|| (productAPIResources.FirstOrDefault(t => t.name.Contains($"/{singleApiName}")) != null
66-
&& productTagResources.FirstOrDefault(t => t.name.Contains($"/{TagName}")) != null))
67-
{
63+
|| apiOperationTagResources.Any(t => t.name.Contains($"/{TagName}'"))
64+
|| apiTagResources.Any(t => t.name.Contains($"/{TagName}'"))
65+
|| (productAPIResources.Any(t => t.name.Contains($"/{singleApiName}"))
66+
&& productTagResources.Any(t => t.name.Contains($"/{TagName}'"))))
67+
{
6868
Console.WriteLine("'{0}' Tag found", TagName);
6969
templateResources.Add(TagTemplateResource);
70-
}
70+
}
7171
}
7272

7373
armTemplate.resources = templateResources.ToArray();
7474
return armTemplate;
7575
}
7676
}
77-
}
77+
}

0 commit comments

Comments
 (0)