Skip to content

Using NodaTime in EF Core yield InvalidCastException in EF6 #181

@Bouke

Description

@Bouke

I'm writing an application that's in the process of migrating to .NET 5 / Core / EF Core. However as most of the projects are targeting .NET Framework, this change will take some time. In the interim, we're writing new projects in EF Core 3.1, while the existing projects continue to work on EF6.

NodaTime isn't being used for the entities in the EF6 project (just DateTimeOffset / DateTime). However after adding NodaTime to the EFCore project, querying EF6 yields a InvalidCastException on the following lines: https://github.com/npgsql/npgsql/blob/613f095dede08f89a596c4360a6f3d8477050688/src/Npgsql/NpgsqlDataReader.cs#L1641-L1643.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions