Catalog: ASP. NET MVC4 get started to Master Series catalog summary
In the previous chapters, some of the techniques and knowledge points that are commonly used in the ASP. NET MVC project are more of a theoretical one, and then I'll use a simple OA project to apply some of the techniques we've covered, In order to take into account the beginner, so I try to put the operating procedures sufficiently detailed. (originally wanted to use VS2015 to demonstrate the development of MVC5, but the home notebook is the February 11 's classic machine, has never been willing to change, because of the configuration , notebook unbearable load, difficult to install the latest version of the development tools, only installed VS2012, of course, Another reason is that the company is now using VS2012 and MVC4. )
Development environment:Win7 64bit,VS2012,sqlserver2008
Using frames:ASP. Mvc4 , EF5,spring.net ,easyui1.4x
1. New Blank Solution
2. Create a new solution folder
New Solution folders can be categorized to package a number of projects, making the whole project clearer.
Common: Infrastructure, contains some common components, and IOC containers
Repository: Data Warehousing
Service: Services layer (business logic and API interface)
UI: Interface (MVC project)
3. New MVC Project
Right-click the UI folder and create a new project
In order to put the controller separately as a project, here we delete the Controller folder
4. Create a new class library to serve as the business logic layer of the UI, or to be built under the UI directory
Now I suddenly want to change the name of the project , the OA to the Web, this time, first in the solution to rename the project name, and then remove the project, then go to the solution directory to find the corresponding folder of the project OA , change the folder name to OA, and thenadd a reference to the project again.
5, in order to establish a good other projects, in addition to Web projects, the other is a class library project, and ultimately such as:
Web.logic is the equivalent of an independent controller project.
To create a database, first download the SQL script (: Http://pan.baidu.com/s/1OLxQA) and run it on SQL server . This SQL script is downloaded from the Internet and is an OA database.
6. New Entity Data Model
7. Modify the configuration file
Because the global configuration is used in the Web project, the configuration in App. config is copied to the Web . config in
8. Add references between projects
Model
Idal-->model
Dal-->idal,Model
Ibll-->model
BLL-->IBLL,idal,Model,DI
WEB.LOGIC-->IBLL,Model,DI
Web-->web.logic,Model
Right-click the solution-project dependencies to view references between projects
Suddenly 0 o'clock, first wash and sleep, recently Shenzhen really cold, 555~ not finished, to be continued ....
22. ASP. NET MVC Introduction to Mastery--build project framework