Code Monkey home page Code Monkey logo

cleanarchitecturewithdapper's Introduction

Clean Architecture With Dapper in .NET 5 leveraging Unit of Work and Repository Pattern

There are plenty of examples in GitHub for a working skeleton implementing a clean architecture in .NET. However, most of them (if not all) use Entity Framework. Even though, I like EF because it brings a lot of functionality out of the box, I think there are more performant alternatives. One of them is definitely Dapper. Now, this library is a Micro ORM, so it is not expected to have all the functionality as EF. For example: in EF the context provides the unit of work automatically. In Dapper, we have to deal with transactions ourselves. So, I created this simple project to showcase the clean architecture (onion approach) with Dapper using the unit of work. I took some of the ideas from other open source repositories like https://github.com/timschreiber/DapperUnitOfWork, because it is important to dispose the connection and transaction when using dependency injection on disposable objects.

The project uses:

  • ASP.NET 5 - Web Api
  • Dapper with unit of work for transactions and repository pattern
  • Dependency injection
  • AutoMapper
  • Clean Architecture

I hope this helps ;)

cleanarchitecturewithdapper's People

Contributors

orodriguezv avatar

Stargazers

Mohamed Ibrahim avatar plunix avatar  avatar

Watchers

plunix avatar  avatar

Forkers

mehmetbilen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.