I have started upgrading one of our internal software applications, written in ASP.NET Web Forms, and moving to ASP.NET MVC.
I am trying to leverage the Repository design pattern for my classes, which leads me to my question about how much to put into a repository.
I have the following entities:
- Topic
- Topic Comments (Topic can have multiple comments)
- Topic Revisions (Any time a Topic is edited, a revision is recorded)
- Topic Subscriptions (Allows users to subscribe to changes for a particular Topic)
I currently have an interface for ITopicRepository and a class called TopicRepository that handles all the basic CRUD for a Topic. I am now preparing to add code for the Comments, Revisions and Subscriptions.
I am wondering does ALL this go into the TopicRepository OR do I create a repository for each of the entities, for example, TopicRevisionRepository and so on.