Skip to content

Change the default mapping for date/time to DateOnly/TimeOnly #5328

@roji

Description

@roji

The default reading value for PG date and time are currently DateTime and TimeSpan, respectively. We support mapping DateOnly and TimeOnly as well, but since these were only introduced in net6.0, we did not make these the default, as it would mean different defaults across different TFMs (older TFMs would have to still return DateTime/TimeSpan).

Now that we've decided to drop .NET Framework and unsupported TFMs, net6.0 will be the lowest TFM for 9.0, which means we can change the default mapping to DateOnly/TimeOnly if we want to. This will be a breaking change for code using non-generic read APIs (e.g. ExecuteScalar, DbDataReader.GetValue) and expecting DateTime/TimeSpan.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions