项目作者: sakopov

项目描述 :
Ambient context implementation for Dapper.NET
高级语言: C#
项目地址: git://github.com/sakopov/Dapper.AmbientContext.git
创建时间: 2016-06-21T04:30:48Z
项目社区:https://github.com/sakopov/Dapper.AmbientContext

开源协议:MIT License

下载


Dapper.AmbientContext

Build status
NuGet Pre Release

Ambient context implementation for Dapper.

Ambient Context is a little-known pattern which is frequently used by the .NET framework to address cross-cutting concerns such as security (Thread.CurrentPrincipal), logging (Trace & TraceListeners), HttpContext and etc. The general idea is that the application sets up a context, typically at an entry-point of an operation or web request, which becomes available to the rest of the system via a static property or method.

Dapper.AmbientContext uses a similar approach to treat the database connection and transaction as resources which are seamlessly shared between various data access components. This pattern works really well with the service layer which consumes multiple data access repositories, commands and queries to perform a variety of database tasks within the same transaction.

More information in the wiki.

Installation

Install Dapper.AmbientContext with NuGet

  1. Install-Package Dapper.AmbientContext