Refined deserialization fixup.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user