Skip to content

Commit 4837da9

Browse files
authored
Merge pull request #22 from Dini001/patch-2
Adding deserialization support for Enums
2 parents 87f6724 + 1be677a commit 4837da9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

FileContextCore/Serializer/SerializerHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public static object Deserialize(this string input, Type type)
4848
return arr.ToArray();
4949
}
5050

51+
if (type.IsEnum)
52+
{
53+
return Enum.Parse(type, input);
54+
}
5155

5256
return Convert.ChangeType(input, type, CultureInfo.InvariantCulture);
5357
}

0 commit comments

Comments
 (0)