Dapper.Data NuGet Package

The connection management wrapper for Dapper.net.
***************************************
// To create an instance of database context inherit DbContext
class TestDb : DbContext
{
private const string ConnectionName = "DefaultConnection";
private TestDb()
: base(ConnectionName)
{ }
}

// execute multiple statatements using same connection
// connection and transaction (if needed)
var db = new TestDb();
db.Batch(s =>
{
s.BeginTransaction();
try
{
s.Execute([Your query]);
s.CommitTransaction();
}
catch
{
s.RollbackTransaction();
throw;
}
});

// using it with ninject
kernel.Bind<IDbContext>().To<TestDb>().InSingletonScope();.




Got any Dapper.Data Question?





Info

Version: 2.0.0
Author(s): Maxim Konstantinovski
Last Update: Tuesday, July 25, 2017
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/mkonstan/Dapper.Data
NuGet Url: https://www.nuget.org/packages/Dapper.Data


Install
Install-Package Dapper.Data
dotnet add package Dapper.Data
paket add Dapper.Data
Dapper.Data Download (Unzip the "nupkg" after downloading)

.NETFramework 4.0 .NETFramework 4.5 .NETStandard 1.3 netcoreapp1.1


Tags



STATS

must-have-score

1.6

avg-downloads-per-day

14

days-since-last-release

2458