Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct non-NodaTime date/time type mappings when NodaTime is configured #3214

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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