Skip to content

Commit d2f7883

Browse files
fix for not null enum type (#314)
1 parent b1b8e7d commit d2f7883

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Drivers/NpgsqlDriver.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,10 @@ string AddRowsToCopyCommand()
608608
{
609609
return (el, notNull, isDapper) =>
610610
{
611-
var enumToStringStmt = $"{el}.Value.Stringify()";
612611
var nullValue = isDapper ? "null" : "(object)DBNull.Value";
613612
return notNull
614-
? enumToStringStmt
615-
: $"{el} != null ? {enumToStringStmt} : {nullValue}";
613+
? $"{el}.Stringify()"
614+
: $"{el} != null ? {el}.Value.Stringify() : {nullValue}";
616615
};
617616
}
618617

0 commit comments

Comments
 (0)