All Projects → zzzprojects → Dapper.Transaction

zzzprojects / Dapper.Transaction

Licence: MIT license
IDbTransaction extension methods for Dapper: A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..

Programming Languages

C#
18002 projects

Library Powered By

This library is powered by Dapper Plus

Dapper Plus

What's Dapper Transaction?

Dapper Transaction is exactly like Dapper but extend the IDbTransaction interface instead and use Dapper under the hood.

It's a simple library to make it easier to work with a transaction.

Everything Dapper support, Dapper Transaction support it as well.

using (var connection = new SqlConnection(FiddleHelper.GetConnectionStringSqlServerW3Schools()))
{
	connection.Open();
	
	using (var transaction = connection.BeginTransaction())
	{
		// Dapper
		var affectedRows1 = connection.Execute(sql, new {CustomerName = "Mark"}, transaction: transaction);
		
		// Dapper Transaction
		var affectedRows2 = transaction.Execute(sql, new {CustomerName = "Mark"});

		transaction.Commit();
	}
}

Method Supported

  • Execute
  • ExecuteAsync
  • ExecuteReader
  • ExecuteReaderAsync
  • ExecuteScalar
  • ExecuteScalarAsync
  • Query
  • QueryAsync
  • QueryFirst
  • QueryFirstAsync
  • QueryFirstOrDefault
  • QueryFirstOrDefaultAsync
  • QuerySingle
  • QuerySingleAsync
  • QuerySingleOrDefault
  • QuerySingleOrDefaultAsync
  • QueryMultiple
  • QueryMultipleAsync

Useful links

Contribute

Want to help us? Your donation directly helps us maintain and grow ZZZ Free Projects.

We can't thank you enough for your support 🙏.

👍 One-time donation

❤️ Become a sponsor

Why should I contribute to this free & open-source library?

We all love free and open-source libraries! But there is a catch... nothing is free in this world.

We NEED your help. Last year alone, we spent over 3000 hours maintaining all our open source libraries.

Contributions allow us to spend more of our time on: Bug Fix, Development, Documentation, and Support.

How much should I contribute?

Any amount is much appreciated. All our free libraries together have more than 100 million downloads.

If everyone could contribute a tiny amount, it would help us make the .NET community a better place to code!

Another great free way to contribute is spreading the word about the library.

A HUGE THANKS for your help!

More Projects

To view all our free and paid projects, visit our website.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].