Skip to content

Commit

Permalink
Improve TaskItem implementation (for metadata).
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Aug 18, 2018
1 parent 358036b commit 2f325dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/StructuredLogger/ObjectModel/TaskItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ public IDictionary CloneCustomMetadataEscaped()

public void CopyMetadataTo(ITaskItem destinationItem)
{
throw new NotImplementedException();
foreach (var kvp in Metadata)
{
destinationItem.SetMetadata(kvp.Key, kvp.Value);
}
}

public string GetMetadata(string metadataName)
{
Metadata.TryGetValue(metadataName, out var result);
return result;
return result ?? "";
}

public string GetMetadataValueEscaped(string metadataName)
Expand Down

0 comments on commit 2f325dc

Please sign in to comment.