Skip to content

Commit

Permalink
Translate DateTime.Date without type mapping in legacy mode (#3032)
Browse files Browse the repository at this point in the history
Fixes #3031

(cherry picked from commit 10aebeb)
  • Loading branch information
roji committed Dec 19, 2023
1 parent fa8c94c commit 9d635b3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class NpgsqlDateTimeMemberTranslator : IMemberTranslator
switch (instance?.TypeMapping)
{
case NpgsqlTimestampTypeMapping:
case NpgsqlTimestampTzTypeMapping when NpgsqlTypeMappingSource.LegacyTimestampBehavior:
case { } when NpgsqlTypeMappingSource.LegacyTimestampBehavior:
return _sqlExpressionFactory.Function(
"date_trunc",
new[] { _sqlExpressionFactory.Constant("day"), instance! },
Expand Down Expand Up @@ -225,4 +225,4 @@ SqlExpression LocalNow()

_ => null
};
}
}

0 comments on commit 9d635b3

Please sign in to comment.