I have a class User where Role is enum with values: Employee, Admin etc... Dapper throws an exception: "The member Role of type System.Enum cannot be used as a parameter value"
Does dapper support enums?
IDbConnection connection
connection.Execute(sb.ToString(), entityToInsert, /*transaction: transaction*/tx, commandTimeout: commandTimeout);
Enums are supported, but Enum
isn't :p
So if you have:
class User {
public MemberRole Role {get;set;}
}
then that should work fine; however
class User {
public Enum Role {get;set;}
}
will not. Are you perhaps using the latter?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With