The last time I completed the user part of member, I am now going to do the article Management Section. This section displays the list of actual articles, publishes articles, modifies articles, and deletes Articles. The ultimate goal is to use permissions to control whether users can perform corresponding operations. The Administrator permission will display the list of all articles and my articles. Common users only display the list of my articles. You cannot determine the permissions you have not granted. You can perform operations after logging on to the console.
I. General description
Let's take a look at the functions of the article's management ideas:
InterfaceCommonModelRepository: InterfaceBaseRepository <Models. CommonModel>
Add InterfaceCategory, InterfaceArticle, and InterfaceAttachment in sequence, in the same way as the public model interface.
2. DAL
Whether to implement the IDAL interface in DAL or add CommonModelRepository first from CommonModel. It is also similar to the original direct inheritance without any code.
CommonModelRepository:BaseRepository<Models.CommonModel>
Add CategoryRepository, ArticleRepository, and AttachmentRepository in sequence.
3. IBLL
This time, we will start with InterfaceCategoryService, InterfaceArticleService, InterfaceCommentService, and InterfaceAttachmentService. InterfaceCommonModelService is mostly placed at the end.
InterfaceCategoryService
The specific functions will be written when you are working on the topic.
InterfaceCategoryService:InterfaceBaseService<Models.Category>
4. BLL
Similarly, you must first start with CategoryService, and then add ArticleService and AttachmentService in sequence. CommonModelService.
CategoryService:BaseService<Category> CategoryService() :
5. Web
Add three empty controllers in the Member area of the web Project.
Topic controller CategoryController
CategoryController() { categoryRepository =
Article controller ArticleController
ArticleController() { articleService = ArticleService(); commonModelService =
AttachmentController
The architecture is over. The article functions will be implemented tomorrow!