C#C
C#4y ago
68 replies
Thinker

What's a repository and the repository pattern? [Answered]

Some articles are telling me that a repository is in essence just an interface that abstracts data access such that it doesn't what the underlying database is. I know there's usually an
IWhateverRepository
interface for a repository which just defines methods for enumerating and getting objects. Is this all there is to it?
"The idea behind the Repository pattern is to decouple the data access layer from the business access layer of the application so that the operations (such as adding, updating, deleting, and selecting items from the collection) is done through straightforward methods without dealing with database concerns such as connections, commands, and so forth."
Was this page helpful?