Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repository Pattern in C#

I am trying to figure out the repository pattern for .NET. I think I have a pretty decent understanding of it, but I still don't feel comfortable using it.

I have googled for this topic, but found some advanced topics along with the repository pattern. What I am looking for is a basic knowledge of the concept, then I can build on it. With that said, can I get a recommendation of some good articles on the repository pattern?

Thanks

like image 596
Skadoosh Avatar asked Feb 10 '10 19:02

Skadoosh


People also ask

What is meant by repository pattern?

The Repository pattern. Repositories are classes or components that encapsulate the logic required to access data sources. They centralize common data access functionality, providing better maintainability and decoupling the infrastructure or technology used to access databases from the domain model layer.

What is the type of repository pattern?

Repository can be viewed as a special kind of Façade (structural) but also as a special kind of Factory (creational). Also, as the Repository often expose collection-like interface, then it might be a special application of Iterator (behavioral).

What is repository pattern and unit of work?

The repository and unit of work patterns are intended to create an abstraction layer between the data access layer and the business logic layer of an application.


4 Answers

See the answers to Repository pattern tutorial in C#.

like image 88
Oded Avatar answered Oct 12 '22 17:10

Oded


I recommend start by Fowler's definition

This concrete implementation could help you as well : )

like image 41
SDReyes Avatar answered Oct 12 '22 16:10

SDReyes


Ayende's Rhino.Commons has a decent implementation.

I also benefitted from reading "Domain-Driven Design" by Eric Evans, which gives a good foundation of understanding the motivations behind Repository.

like image 26
codekaizen Avatar answered Oct 12 '22 17:10

codekaizen


Have a look at following Article.

like image 38
Asad Avatar answered Oct 12 '22 17:10

Asad