Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consider allowing unmapped enums to be written as int/string #3303

@roji

Description

@roji

@mikependon did a lot of comparative work on enum coercion across ADO.NET providers (thanks @mikependon!) - the results can be seen here: https://twitter.com/mike_pendon/status/1325442299862659074.

Bottom line:

  • When DbType.String or DbType.Integer are set, enums are properly coerced by all providers except Npgsql
  • When DbType isn't set, some inconsistent behavior occurs, e.g. the int value would be textually saved in text columns in some cases.

I don't think we should support this without DbType (especially in light of the weird/problematic behavior across providers), but we should consider aligning with others and at least allowing DbType.String/Integer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions