Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Fix bad merge.
  • Loading branch information
martincostello committed May 8, 2024
1 parent bc631a7 commit 7047662
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DataContract GetDataContractForType(Type type)
{
var enumValues = type.GetEnumValues();

//Test to determine if the serializer will treat as string
// Test to determine if the serializer will treat as string
var serializeAsString = (enumValues.Length > 0)
&& JsonConverterFunc(enumValues.GetValue(0), type).StartsWith("\"");

Expand All @@ -64,7 +64,7 @@ public DataContract GetDataContractForType(Type type)
// This is a special case where we know the possible key values
var enumValuesAsJson = keyType.GetEnumValues()
.Cast<object>()
.Select(value => JsonConverterFunc(value, type));
.Select(value => JsonConverterFunc(value, keyType));

keys = enumValuesAsJson.Any(json => json.StartsWith("\""))
? enumValuesAsJson.Select(json => json.Replace("\"", string.Empty))
Expand Down

0 comments on commit 7047662

Please sign in to comment.