Closed dmdymov closed 6 years ago
What if you rename the Value
property to something else? Value
might be a reserved keyword in your database.
This is definitely an issue https://stackoverflow.com/questions/53052693/dapper-fluent-mapping-bug-for-nullable-decimal
Taking a quick look at the source of Dapper, the failing call to Emit(opcode, meth)
is probably this one where the property setter is resolved from the type map (the type map which Dapper.FluentMap provides), not sure what is causing it to return null
though.
I'll look further into this soon.
@dmdymov this is definitely an issue with a specific Value
property name. The Nullable<T>
class has a Value
property as well and Dapper.FluentMap is searching for properties on base classes and it finds the Value
property of Nullable<decimal>
and attempts to map to that.
This obviously is a bug and needs fixing. Perhaps you can try and use another property name in the meanwhile?
@henkmollema, we'll try another property name. Thank you.
Dapper 1.50.5, Dapper.FluentMap 2.0.0-beta1.
DB:
This code throws
ArgumentNullException
atQuery
line. IfValue
is declareddecimal
it works just fine.Stack: