DapperLib / DapperLib/DapperAOT

Converting Query<MyObject> to QueryFirstOrDefault<MyObject> breaks query

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
472
Forks
43
Avg merge
1d 4h
Merged PRs (30d)
18

Description

At the suggestion of the Dapper.AOT system I converted SELECT query type calls from Query("SELECT * FROM my_object_table WHERE id=@foo") style calls to the QueryFirstOrDefault() syntax

What happens is for the same SQL, the query returns an empty object so it breaks things.

**Where are you seeing this?

Dapper 2.1.35
Dapper.AOT 2.0.78

MariaDB 10.11.6

To Reproduce

Try a query with Dapper before and after converting to the QueryFirstOrDefault() style

Expected behavior

I expected my queries to work as before

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by creating the minimal comparison described in the issue using Dapper 2.1.35, Dapper.AOT 2.0.78, and MariaDB 10.11.6, then compare Query with QueryFirstOrDefault for the same SQL. Done means the converted query returns the expected populated object rather than an empty one.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, mariadb
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.