Skip to content

Commit

Permalink
Correct non-NodaTime date/time type mappings when NodaTime is configu…
Browse files Browse the repository at this point in the history
…red (#3214)

Fixes #3213
  • Loading branch information
roji authored Jun 28, 2024
1 parent 933bc8d commit dba77fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class NpgsqlDateTimeMemberTranslator : IMemberTranslator
public NpgsqlDateTimeMemberTranslator(IRelationalTypeMappingSource typeMappingSource, NpgsqlSqlExpressionFactory sqlExpressionFactory)
{
_typeMappingSource = typeMappingSource;
_timestampMapping = typeMappingSource.FindMapping("timestamp without time zone")!;
_timestampTzMapping = typeMappingSource.FindMapping("timestamp with time zone")!;
_timestampMapping = typeMappingSource.FindMapping(typeof(DateTime), "timestamp without time zone")!;
_timestampTzMapping = typeMappingSource.FindMapping(typeof(DateTime), "timestamp with time zone")!;
_sqlExpressionFactory = sqlExpressionFactory;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public NpgsqlDateTimeMethodTranslator(
{
_typeMappingSource = typeMappingSource;
_sqlExpressionFactory = sqlExpressionFactory;
_timestampMapping = typeMappingSource.FindMapping("timestamp without time zone")!;
_timestampTzMapping = typeMappingSource.FindMapping("timestamp with time zone")!;
_intervalMapping = typeMappingSource.FindMapping("interval")!;
_timestampMapping = typeMappingSource.FindMapping(typeof(DateTime), "timestamp without time zone")!;
_timestampTzMapping = typeMappingSource.FindMapping(typeof(DateTime), "timestamp with time zone")!;
_intervalMapping = typeMappingSource.FindMapping(typeof(TimeSpan), "interval")!;
_textMapping = typeMappingSource.FindMapping("text")!;
}

Expand Down
1 change: 0 additions & 1 deletion src/EFCore.PG/Storage/Internal/NpgsqlTypeMappingSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Text.Json;
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal;
using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping;
using Npgsql.Internal;

namespace Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal;

Expand Down

0 comments on commit dba77fd

Please sign in to comment.