Skip to content

Commit 2240457

Browse files
add [System.Text.Json.Serialization.JsonConstructor] atribute to TaskItemDto
1 parent 4412c4e commit 2240457

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Common/VSHostObject.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,16 @@ static TaskItem ConvertToTaskItem(TaskItemDto dto)
126126
}
127127
}
128128

129-
private readonly record struct TaskItemDto(string? ItemSpec, Dictionary<string, string>? Metadata);
129+
private readonly struct TaskItemDto
130+
{
131+
public string? ItemSpec { get; }
132+
public Dictionary<string, string>? Metadata { get; }
133+
134+
[System.Text.Json.Serialization.JsonConstructor]
135+
public TaskItemDto(string? itemSpec, Dictionary<string, string>? metadata)
136+
{
137+
ItemSpec = itemSpec;
138+
Metadata = metadata;
139+
}
140+
}
130141
}

0 commit comments

Comments
 (0)