ASP. NET MVC5 website development practices (2) Member Region

Source: Internet
Author: User

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.


Add CategoryRepository, ArticleRepository, and AttachmentRepository in sequence.


This time, we will start with InterfaceCategoryService, InterfaceArticleService, InterfaceCommentService, and InterfaceAttachmentService. InterfaceCommonModelService is mostly placed at the end.


The specific functions will be written when you are working on the topic.


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 = 



The architecture is over. The article functions will be implemented tomorrow!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.