DapperLib / DapperLib/DapperAOT

Support Dapper overloads with CommandDefinition

Open
#112 6 comments 14 reactions 1 assignee View on GitHub

@DeagleGross is already working on this.

Since Sep 23, 2024.

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

Description

I am using the Dapper overloads which accept a CommandDefinition because I want to pass CancellationToken, for example:

        var result = await conn.ExecuteScalarAsync<string>(new CommandDefinition("sp_CrunchNumbers",
            new
            {
                WarpFactor = 43
            },
            commandType: CommandType.StoredProcedure,
            cancellationToken: cancellationToken));

The analyzer doesn't seem to detect this usage and generate code.

If I change to the overload which takes multiple args then it does generate code, however this doesn't support CancellationToken.

        var result = await conn.ExecuteScalarAsync<string>("sp_CrunchNumbers",
            new
            {
                WarpFactor = 43
            },
            commandType: CommandType.StoredProcedure);

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.