-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
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
Missing implicit numeric cast of decimal to integer in C# record #1933
Comments
Anyone? :/ |
Well, the good news is that in DapperAOT this should work identically in the two modesb- but DapperAOT is dependent on new compiler features in the net8 release (note: it is not dependent on net8 itself - just the build tools / build SDK). The constructor path in vanilla Dapper is ... limited. I'll take a look later to see what the current state is. |
Your Oracle number is probably unconstrained, e.g. NUMBER instead of NUMBER(9,0). For example, this errors unless the destination object has System.Decimal for some_column: I have never found a workaround for this other than modifying the structure of the table. |
Correction, I do have some code that uses Oracle's TO_BINARY_DOUBLE() function in the SQL, which does map to a System.Double. This is not great as the SQL needs to be modified, but works when you cannot change the database structure, which is often. |
Hi, I've found that Dapper behaves differently when using plain classes or records (working on Oracle 12).
When getting results from a command, like
this
works fine while this
throws
System.InvalidOperationException: A parameterless default constructor or one matching signature (System.Decimal ID) is required for SomeNamespace.SomeObjectmaterialization
If I change property data type, like this
it works, but I don't want to use decimal instead of int.
The text was updated successfully, but these errors were encountered: