Refined deserialization fixup.

This commit is contained in:
John Wesley Walker III
2023-02-27 17:45:57 +00:00
parent cb89be7aac
commit f3961c4895
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ namespace GitHub.Runner.Worker
// Close-over the incoming IEnumerable to force immediate evaluation.
var empty = Enumerable.Empty<KeyValuePair<string, string>>();
this.Data = new Dictionary<string, string>(data ?? empty);
this.Data = new Dictionary<string, string>(data ?? empty, StringComparer.OrdinalIgnoreCase);
}
public readonly string Category;
+5 -1
View File
@@ -25,7 +25,6 @@ namespace GitHub.DistributedTask.WebApi
private Issue(Issue original)
{
// DataContractSerializer bypasses all constructor logic and inline initialization!
this.EnsureInitialized();
if (original != null)
{
@@ -107,6 +106,11 @@ namespace GitHub.DistributedTask.WebApi
private IDictionary<string, string> m_data;
/// <summary>
/// DataContractSerializer bypasses all constructor logic and inline initialization!
/// This method takes the place of a workhorse constructor for baseline initialization.
/// The expectation is for this logic to be accessible to constructors and also to the OnDeserialized helper.
/// </summary>
private void EnsureInitialized()
{
m_data = m_data ?? new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);