Skip to content

Support Dapper overloads with CommandDefinition #112

Open
@batwad

Description

@batwad

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);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions