Fixes "Enum Invalid cast from 'System.Int64' (works without AOT)" #92#171
Open
andreasblueher wants to merge 6 commits intoDapperLib:mainfrom
Open
Fixes "Enum Invalid cast from 'System.Int64' (works without AOT)" #92#171andreasblueher wants to merge 6 commits intoDapperLib:mainfrom
andreasblueher wants to merge 6 commits intoDapperLib:mainfrom
Conversation
in advance of changes for DapperLib#92
# Conflicts: # Directory.Packages.props # test/Dapper.AOT.Test/Dapper.AOT.Test.csproj
Convert.ChangeType does not support enum target types, causing InvalidCastException when the reader returns Int64/Byte/String for enum-typed properties. Use Enum.ToObject for numeric values and Enum.Parse for strings instead. Also adjust SqliteTests to exclude NETFRAMEWORK since main dropped the System.Data.SQLite package reference.
Cover Int64, Int32, Byte to enum, string to enum (case-insensitive), nullable enum, and null-to-nullable-enum paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @mgravell,
here's the pull request you asked for. I based it on the issue92 branch you had already created and not on main, which caused some sqllite things to end up in this branch. I can create another branch based on your main if needed.
#92
I tried to change as little as possible. Kind regards and thank you for the tool