We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
if (property.PropertyType.IsEnum) { Enum.TryParse(property.PropertyType, value.ToString(), true, out var result); return result; // additional checks required }
The text was updated successfully, but these errors were encountered:
Works for me, @Kusumoto Could you release the fix?
Sorry, something went wrong.
I already try, it work but TryParse method just work for .NET Standard 2.0 only.
TryParse
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 :)
Kusumoto
No branches or pull requests
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)
The text was updated successfully, but these errors were encountered: