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

Bug: Retrieving DateOnly from reader is wrong #1150

Open
xperiandri opened this issue Jun 8, 2023 · 0 comments
Open

Bug: Retrieving DateOnly from reader is wrong #1150

xperiandri opened this issue Jun 8, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xperiandri
Copy link
Contributor

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

@xperiandri xperiandri added the bug Something isn't working label Jun 8, 2023
@mikependon mikependon changed the title Bug: Retrieving DateOnly from reader is wrond Bug: Retrieving DateOnly from reader is wrong Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants