ASP. NET MVC5 website development practices

Source: Internet
Author: User

I have been using MVC4 to write a website development demo some time ago. Since I first learned how to write all the code in a project, the more chaotic the writing, later, some codes were hard to understand. On the evening of June January 26, I spoke to @ in a group to discuss this issue. The conclusion is that even a small demo should be written in layers. I can see that someone else is using MVC5 to write things. I immediately downloaded Visual Studio 2013. Fortunately, MVC4 and MVC5 have not changed much. I am going to re-write a Demo with MVC5 this time. Every time I read the previously written code, I always have the urge to throw it into the recycle bin. In fact, there is no perfect code, and the code that can solve the problem is good code, however, I decided to re-write a learning Demo. I hope it will be improved this time. I hope it will be finished this time!

I. Development Environment

1. Development Environment: Visual Studio 2013

2. Database: SQL Server 2012.

3. Code Management: TFS (provided by Microsoft for free)

Note: VS2013 and vs2012 do not change much. I downloaded the Pro version, and the database is the sqlserver database that comes with vs2013. Code Management uses the free tfs provided by Microsoft (now called Visual Studio Online). The free version includes five users, unlimited team projects and private code repositories, I often use other computers in other places. The purpose of using tfs is to share code and back up data.

Ii. Technologies Used

The first four items are added by default for creating projects. I have never thought about Easyui usage. Sometimes I think that as a website project, non-management software is not needed as much as possible.

Let's talk about mvc5. The introduction does not change much between mvc5 and MVC4.

1. One ASP. NET.This is a new feature of asp.net. It should not be MVC. It generally means that Web Forms, MVC, and Web APIs can be combined in a project. webforms can be added to mvc, you can add APIs. This applies to other projects.

2. ASP. NET Identity. The new membership system is based on OWIN, and the other is managed using Entity Framework Code First, allowing you to expand user fields by yourself.

3. Bootstrap.Good interface. Unfortunately, I don't understand it. I just learned this time.

III, Project Structure

 

 

  •  Web Project: An MVC project that interacts with users. The attempt and controller section in MVC, and the attempt model (suffixed with ViewModel) that properly defines the interaction between views and controllers ). It consists of two regions: Member (User region) and Manage (management region ).
  • Models project: Model type. It is generally a type of data that interacts with a database or project (excluding the attempted model ).
  • Common Project: Put some public methods, such as encryption, conversion, and verification code generation.
  • IDAL Project: Data access layer interface, which defines the operation methods through EF and the database.
  • DAL Project: Data access layer, inherited from IDAL and implemented its defined methods.
  • IBLL Project: Business logic layer interface, which defines how to provide services for Web projects by calling the data access layer and processing it.
  • BLL Project: Business logic layer that inherits from IBLL and implements its defined methods.

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: info-contact@alibabacloud.com 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.