Skip to content

Bug: Retrieving DateOnly from reader is wrong #1150

Open
@xperiandri

Description

@xperiandri

Bug Description

Compiler gets method GetDateTime instead of GetFieldValue<DateOnly>

internal static MethodInfo GetDbReaderGetValueMethod(Type targetType) =>
StaticType.DbDataReader.GetMethod(string.Concat("Get", targetType?.Name));

causing type mismatch exception here

internal static Expression ConvertExpressionToTypeExpression(Expression expression,
Type toType) =>
(expression.Type != toType) ? Expression.Convert(expression, toType) : expression;

See
https://github.com/npgsql/npgsql/blob/fcfafc138608b56a027bae7c121de4ddfccb5090/test/Npgsql.Tests/Types/DateTimeTests.cs#L108

Library Version:

RepoDb v1.13.1 and RepoDb.PostgeSQL v1.13.1
But built from the latest main

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions