Open duhapunk opened 1 year ago
Works for me, @Kusumoto Could you release the fix?
Works for me, @Kusumoto Could you release the fix?
I already try, it work but TryParse
method just work for .NET Standard 2.0 only.
This is the major change because after support this I'll obsolete .NET Framework support.
Did you try "manual" TryParse ? Something like this
try
{
var val = Enum.Parse(property.PropertyType, value.ToString(), true);
var result = Convert.ChangeType(val, property.PropertyType);
// additional checks required
return result;
}
catch (Exception ex)
{
// do some stuff
return null;
}
Enum filtering would be great, if this could be incorporated :)
Hello again! I noticed that your lib doesn't support enums. I fixed it like this:
if (propertyType == typeof(bool) || propertyType == typeof(bool?) || propertyType.IsEnum)