EntityFramework6.Npgsql icon indicating copy to clipboard operation
EntityFramework6.Npgsql copied to clipboard

Mapping entity enums to numeric fields (int2, int4, int8) casues casts

Open McDoit opened this issue 8 years ago • 0 comments

When I map entity enums to numeric fields (int2, int4, int8) it casues the generated sql to contain casts from the correct value to the same.

For example a int2 column mapped to a enum based on a short becomes cast("C1" as int2) "C1" even if C1 already are of type int2

This affects both select and where statements, I haven't checked the case of joins. And I don't know if Postgres is smart enough to skip this cast if the column already are of the correct type?

McDoit avatar Mar 16 '17 14:03 McDoit