Skip to content

Commit 2f325dc

Browse files
committed
Improve TaskItem implementation (for metadata).
1 parent 358036b commit 2f325dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/StructuredLogger/ObjectModel/TaskItem.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ public IDictionary CloneCustomMetadataEscaped()
3535

3636
public void CopyMetadataTo(ITaskItem destinationItem)
3737
{
38-
throw new NotImplementedException();
38+
foreach (var kvp in Metadata)
39+
{
40+
destinationItem.SetMetadata(kvp.Key, kvp.Value);
41+
}
3942
}
4043

4144
public string GetMetadata(string metadataName)
4245
{
4346
Metadata.TryGetValue(metadataName, out var result);
44-
return result;
47+
return result ?? "";
4548
}
4649

4750
public string GetMetadataValueEscaped(string metadataName)

0 commit comments

Comments
 (0)