Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions