DapperLib / DapperLib/Dapper

Add convenience methods for IDbTransaction

Open
#1,414 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

At the moment, if you begin a transaction on an IDbConnection, in order to use that transaction in Dapper, one has to pass it in for every Dapper call made. Because an IDbTransaction implies an IDbConnection, it would be much more convenient if all the extension methods on IDbConnection that took a transaction parameter were also extension methods on IDbTransaction, using the transaction's Connection member for the connection. For example:

    public static int Execute(this IDbConnection cnn, string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null);

...would have extension method:

    public static int Execute(this IDbTransaction tran, string sql, object param = null, int? commandTimeout = null, CommandType? commandType = null) {
        return tran.Connection.Execute(sql, param, tran, commandTimeout, commandType);
    }

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

Start by locating the existing IDbConnection extension methods that accept an IDbTransaction. Add corresponding IDbTransaction convenience overloads using the transaction's Connection member, and verify that each delegates with the transaction supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.