# Repository Pattern ## ๐Ÿ“• Articles - [Repository - Martin Fowler](https://martinfowler.com/eaaCatalog/repository.html) - [No need for repositories and unit of work with Entity Framework Core](https://gunnarpeipman.com/ef-core-repository-unit-of-work/) - [Repository and unit of work ARE useful](https://dotnetfalcon.com/repository-and-unit-of-work-are-useful/) - [The generic repository is just a lazy anti-pattern](https://www.ben-morris.com/why-the-generic-repository-is-just-a-lazy-anti-pattern/) - [The Repository Pattern isnโ€™t an Anti-Pattern; Youโ€™re just doing it wrong.](https://brianbu.com/2019/09/25/the-repository-pattern-isnt-an-anti-pattern-youre-just-doing-it-wrong/) - [The Generic Repository Is An Anti-Pattern](https://blog.sapiensworks.com/post/2012/03/05/The-Generic-Repository-Is-An-Anti-Pattern.aspx) - [Repository Pattern in .Net Core](https://www.programmingwithwolfgang.com/repository-pattern-net-core/) - [DDD: The Generic Repository](http://codebetter.com/gregyoung/2009/01/16/ddd-the-generic-repository/) - [Creating A Generic Repository](https://medium.com/@morgankenyon/tinroll-4-creating-a-generic-repository-9846c72e11ec) - [Repository is Dead: Long Live Repository](http://codebetter.com/gregyoung/2009/04/23/repository-is-dead-long-live-repository/) - [More on Repository](http://codebetter.com/gregyoung/2009/04/24/more-on-repository/) - [Avoiding the Repository Pattern with an ORM](https://codeopinion.com/avoiding-the-repository-pattern-with-an-orm/) - [Query Objects instead of Repositories](https://codeopinion.com/query-objects-instead-of-repositories/) - [Building a CachedRepository via Strategy Pattern](https://ardalis.com/building-a-cachedrepository-via-strategy-pattern/?utm_sq=glv8x7culc) - [Adding decorated classes to the ASP.NET Core DI container using Scrutor](https://andrewlock.net/adding-decorated-classes-to-the-asp.net-core-di-container-using-scrutor/) - [Introducing the CachedRepository Pattern](https://ardalis.com/introducing-the-cachedrepository-pattern/) - [Should repositories throw exceptions ?](https://minasami.com/2020/09/14/should-repositories-throw-exceptions.html) - [Repository Pattern in ASP.NET Core with Adapter Pattern for easy Maintenance & better Unit Testing](https://procodeguide.com/programming/repository-pattern-in-aspnet-core/) - [Should Controllers Reference Repositories or Services](https://ardalis.com/should-controllers-reference-repositories-services/) - [Architecting in the pit of doom: The evils of the repository abstraction layer](https://ayende.com/blog/4784/architecting-in-the-pit-of-doom-the-evils-of-the-repository-abstraction-layer) - [Implementing repository querying interface in EF Core DbContext](https://gunnarpeipman.com/ef-core-dbcontext-repository/) - [Repository pattern or DbContext - what's your poison?](https://www.reddit.com/r/dotnet/comments/rc2lzj/repository_pattern_or_dbcontext_whats_your_poison/) - [Repository Pattern C#](https://codewithshadman.com/repository-pattern-csharp/) - [Repository and Unit of Work Pattern](https://www.programmingwithwolfgang.com/repository-and-unit-of-work-pattern/) - [Should you use the Repository Pattern? With CQRS, Yes and No!](https://codeopinion.com/should-you-use-the-repository-pattern-with-cqrs-yes-and-no/) - [Implement Repository Pattern using .NET EF Core](https://thecodeblogger.com/2021/06/27/implement-repository-pattern-using-net-ef-core/) - [EF Core Repository with Specification Pattern in .NET](https://thecodeblogger.com/2021/07/01/ef-core-repository-with-specification-pattern-in-net/) - [Better Enhanced Repository Pattern Implementation in .NET ](https://levelup.gitconnected.com/better-enhanced-repository-pattern-implementation-in-net-c-4e6f4bbe48a9) - [The Repository Pattern is simple yet misunderstood](https://blog.elmah.io/the-repository-pattern-is-simple-yet-misunderstood/) - [Getting Started With Specifications](https://blog.nimblepros.com/blogs/getting-started-with-specifications/) - [Specification Pattern](https://deviq.com/design-patterns/specification-pattern) - [Specification pattern: C# implementation](https://enterprisecraftsmanship.com/posts/specification-pattern-c-implementation/) - [CQRS vs Specification pattern](https://enterprisecraftsmanship.com/posts/cqrs-vs-specification-pattern/) - [Specification Pattern vs Always-Valid Domain Model](https://enterprisecraftsmanship.com/posts/specification-pattern-always-valid-domain-model/) - [Unit of work pattern with Dapper](https://dejanstojanovic.net/aspnet/2021/november/unit-of-work-pattern-with-dapper/) ## ๐Ÿ“บ Videos - [Repository Pattern with C# and Entity Framework - Mosh Hamedani](https://www.youtube.com/watch?v=rtXpYpZdOzM) - [Step by Step - Repository Pattern and Unit of Work with Asp.Net Core 5](https://www.youtube.com/watch?v=-jcf1Qq8A-4) - [Should you use the Repository Pattern? With CQRS, Yes and No!](https://www.youtube.com/watch?v=01lygxvbao4) - [Reviewing the Specification Pattern and NuGet package](https://www.youtube.com/watch?v=BgWWbBUWyig) - [Should we use repositories or not?](https://www.youtube.com/watch?v=1usrGohx8Bo) - [Reviewing the Specification Pattern and NuGet package](https://www.youtube.com/watch?v=BgWWbBUWyig) - [What's new in v5 of Ardalis.Specification](https://www.youtube.com/watch?v=gT72mWdD4Qo) - [Ardalis - Working on the Ardalis.Specification and EF Extensions GitHub projects](https://www.youtube.com/watch?v=PbHic9Ndqoc)o) ## ๐Ÿš€ Samples - [dotnet-architecture/eShopOnWeb](https://github.com/dotnet-architecture/eShopOnWeb/blob/15bd78ee5b753a51fd9f8214a6ee8f5007e2d40f/src/Infrastructure/Data/EfRepository.cs) - [thangchung/clean-architecture-dotnet](https://github.com/thangchung/clean-architecture-dotnet/blob/main/src/N8T.Infrastructure.EfCore/Repository.cs) ## ๐Ÿ“ฆ Libraries - [ardalis/Specification](https://github.com/ardalis/Specification) - Base class with tests for adding specifications to a DDD model - [FoundatioFx/Foundatio.Repositories](https://github.com/FoundatioFx/Foundatio.Repositories) - Generic repositories - [RobThree/MongoRepository](https://github.com/RobThree/MongoRepository) - Repository abstraction layer on top of Official MongoDB C# driver - [urfnet/URF.Core](https://github.com/urfnet/URF.Core) - Unit of Work & Repositories Framework - .NET Core, NET Standard, Entity Framework Core. 100% extensible & lightweight. Live demo: https://goo.gl/QpJVgd - [alexandre-spieser/mongodb-generic-repository](https://github.com/alexandre-spieser/mongodb-generic-repository) - An example of generic repository implementation using the MongoDB C# Sharp 2.0 driver (async) - [esendir/MongoRepository](https://github.com/esendir/MongoRepository) - Repository pattern for MongoDB with extended features - [WeihanLi/WeihanLi.EntityFramework](https://github.com/WeihanLi/WeihanLi.EntityFramework) - EntityFramework extensions - [brunohbrito/MongoDB-RepositoryUoWPatterns](https://github.com/brunohbrito/MongoDB-RepositoryUoWPatterns) - Example of an implementation of Repository and Unit of Work Patterns with MongoDB for ASP.NET Core. - [TanvirArjel/EFCore.GenericRepository](https://github.com/TanvirArjel/EFCore.GenericRepository) - This repository contains Generic Repository implementation for Entity Framework Core - [Daniel127/EF-Unit-Of-Work](https://github.com/Daniel127/EF-Unit-Of-Work) - Repository and Unit of Work pattern implementation for Entity Framework Core. - [SharpRepository/SharpRepository](https://github.com/SharpRepository/SharpRepository) - C# Generic Repository for use with Entity Framework, RavenDB and more with built-in caching options. - [AhmedTarekHasan/BetterRepository](https://github.com/AhmedTarekHasan/BetterRepository) - [threenine/Threenine.Data](https://github.com/threenine/Threenine.Data) - Generic Repository Pattern for .net core - [timschreiber/DapperUnitOfWork](https://github.com/timschreiber/DapperUnitOfWork) - [BaalaSrinivas/Dapper.RepositoryAndUnitOfWork](https://github.com/BaalaSrinivas/Dapper.RepositoryAndUnitOfWork) - [outmatic/Dapper.UnitOfWork](https://github.com/outmatic/Dapper.UnitOfWork)