[MVC] basics and mvc Basics
1: The master page is placed in View/Shared, and all View pages can use the master page.
** The application of the motherboard needs to use nesting, @ RenderBody (); to display all the content of other webpages here, it is equivalent to a placeholder.
2: The architecture mode is the physical understanding of the project, which makes our program better.
** View: displays user data;
** Controller: obtains the data from the View, calls the business logic, and submits the processed data to the View for display;
** Model: process the business logic and return the data results to the Controller;
3: Presentation mode [if the Model is understood as a view Model]
4: The reference in Controller in MVC is in the packmess file in its own project.
The most important thing in MVC is that "Conventions are greater than configurations"
4.1: the name of the Controller class must end with "Controller": HomeController
4.2: the files in the View of the controller are named the same as those in the controller.
4.3: The Action Method of the controller. You can also generate an Index. cshtml file in the View File.
5: Use ViewBag to transmit data to the view, and use the Azone expression to transmit data directly in the view.
@ Html. Raw (ViewBag. HtmlStr)
6: EF (Entity FrameWork)
ORM (Object relationship ing framework/data persistence framework): An Object-Oriented operation framework that operates data in a data table based on an object. The underlying layer also calls Ado.net to connect to the database.
7. In Actiom, parameters are obtained from the foreground by passing parameters through the URL to automatically pass the parameters through route matching.
8: There is a container with some attributes in EF. To use EF, you must instantiate your own values and put them into the container, then, you can call its enumeration method to add, delete, modify, and query databases.
**: Operations in EF <use these steps to add, delete, modify, and query EF>
9: three methods can be used to transmit data from the Controller to the view.
**: ViewBag ViewData and the Model attribute on the data through the View constructor <Return View (model)>
10: @ model MVCBlog. Models. In the view is used to help the Model used below, which is equivalent to introducing the namespace.