I have seen so many ways to write repository pattern. I have read Rob Conery's blog also.
But, according to my experience, the repository pattern is the one constructing criteria by client code and passing it to repository.
A repository is nothing but a mediator between data access layer and business layer.
I will try to explain in a very simplest method to understand repository pattern.
Step 1:
Create VS 2010 project and name it RepPattern.
I have created here a Silverlight application. Because I really like to work with Silverlight.

In this application, I have added two folders.
- Contract:
To hold all interface entity.
That is IPattern interface.
- Service:
To hold all interface implemented class.
That is PatternService class.
Step 2:
In IPattern interface, I have declared signature to get some value. I. e Get default name.
At the same time I have implemented IPattern interface on PatternService class as given below.

These modules belongs to the repository.
Step 3:
Now, it's the time to actually implement this repository.
Here I have added one more class called PatternHelper.cs. Also, I have written one static method to return all repository methods.

Step 4:
Next one is calling these repository methods from client.

Step 5:
Run the application.

As I said before, repository is nothing but a mediator between business logic and data access layer.
Here, PatternHelper works as repository layer.
These separation of business logic and data helps in three ways.
- It centralizes the data logic or Web service access logic.
- It provides a substitution point for the unit tests.
- It provides a flexible architecture that can be adapted as the overall design of the application evolves.
Usage of Repository pattern:
- We can use this pattern to access a data source from many locations yet centrally manage the data source.
- We can test it individually (Unit test).
- Code maintainability.
Thanks
Enjoy the coding!!!!!

Bui Luong TruongPosted May 15, 2015, 7:04 AM
Can you fix your picture in Article? I can't see.
Abhi KumarPosted Jan 4, 2012, 11:36 PM
Very useful article.
Stephen JohnsonPosted Jan 4, 2012, 11:26 PM
Very Good concept of your article.
Emmy DickensPosted Jan 4, 2012, 11:11 PM
nice article
Sonakshi SinghPosted Jan 4, 2012, 11:03 PM
great job done.
Akash AhlawatPosted Jan 4, 2012, 12:03 PM
Nicely written article and helpful too
Jimmy UnderwoodPosted Jan 4, 2012, 11:06 AM
Nice explanation