Skip to content

Commit

Permalink
Init of dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
mivano committed Feb 16, 2024
1 parent d8c5e25 commit abbb267
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CostApi/AzureCostApiRetriever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,16 @@ public async Task<IEnumerable<CostDailyItem>> RetrieveDailyCost(bool includeDebu

// if includeTags is true, row[5] is the tag, and row[6] is the currency, otherwise row[5] is the currency
var currency = row[5].ToString();
Dictionary<string, string> tags = new();
Dictionary<string, string>? tags =null;

// if includeTags is true, switch the value between currency and tags
// that's the order how the API REST exposes the resultset
if (includeTags)
{
var tagsArray = row[5].EnumerateArray().ToArray();

tags = new Dictionary<string, string>();

foreach (var tagString in tagsArray)
{
var parts = tagString.GetString().Split(':');
Expand Down

0 comments on commit abbb267

Please sign in to comment.