Adding Enum deserialization
Fixing issue in SessionBase where it does not correctly deserialize Enum's
This commit is contained in:
@@ -145,6 +145,16 @@ namespace TelegramBotBase
|
||||
|
||||
try
|
||||
{
|
||||
if (f.PropertyType.IsEnum)
|
||||
{
|
||||
var ent = Enum.Parse(f.PropertyType, p.Value.ToString());
|
||||
|
||||
f.SetValue(form, ent);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
f.SetValue(form, p.Value);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
|
||||
Reference in New Issue
Block a user