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

Support Dapper overloads with CommandDefinition #112

Open
batwad opened this issue Feb 3, 2024 · 0 comments
Open

Support Dapper overloads with CommandDefinition #112

batwad opened this issue Feb 3, 2024 · 0 comments
Labels

Comments

@batwad
Copy link

batwad commented Feb 3, 2024

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);
@batwad batwad added the analyzer label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant