This video is available to students only

Introducing Repository Pattern

In this lesson, we're going to introduce Repository pattern

Repository pattern#

In this lesson, we're going to learn about Repository pattern. The Repository Design Pattern in C# is one of the most used design patterns in the real-time application.

So, what does it do? Its main responsibility is to decouple business code from the data-access code. Right now, our Store context is doing the exact same thing but we have to import it in our controller. However, we don't want that. We are going to have more controllers as well rather than just the Course Controller, so we can remove the duplicacy here by using repository pattern and it's always good to keep our controllers clean.

Like Entity Framework giving us separation of concerns by making a connection to the database, Repository pattern gives us separation of concerns from the database Context.

Start a new discussion. All notification go to the author.