Web application development review (Chapter 3 EF framework and LINQ query)

1. When using DbContext or DbSet, the namespace that must be introduced is ()
Insert picture description here
ps: This is the code first mode under the EF framework. Use code to write database relationships in the model, and then use the context class and model class model to automatically build control Server, view, database

Insert picture description here
Insert picture description here

Insert picture description here

2. To design a member registration view, the type of view template should be used ()
Insert picture description here
ps:
①create insert
②delete delete (through the field)
③edit modify and update (through the field)
④details search (through the field)
⑤list is the index (no need to write the method name and parameters in the address , Traverse the entire table)
Insert picture description here

Insert picture description here

3. Among the following methods or properties, which are not defined by the abstract class WebViewPage is (SaveChanges)
Insert picture description here
4. When designing the membership information modification page, you must use the method UpdateModel provided by the class (Controller) to save the model records in the controller action
Insert picture description here
! ! ! 5. Among the following methods, what is not defined by the class DbSet is ()
Insert picture description here
6. If the primary key of the model class is not a self-incrementing int type ID, the application uses the () annotation
Insert picture description here
7. Define methods in the controller to process the submission of the view form, and apply Use () annotation
Insert picture description here
8. Which of the following is not the working method of EF ()
Insert picture description here
9. The following description of Entity Framework is incorrect is ()
Insert picture description here
10. When the data model changes, you can use data migration to update the database. Which of the following is not a command used for data migration ()
Insert picture description here
ps:
These three are used for data migration , note that the last one is to update the database (database)
Insert picture description here

11. When creating a new MVC project, the EF framework ps is automatically introduced
Insert picture description here
: you need to download the reference by yourself

12. The Entity EF framework can only be used in Web projects (wrong)
Insert picture description here
13. The class DbContexct and DbSet are in the same namespace and
Insert picture description here
are both System.Data.Entity;

14. To create a WEB project with database access, you must first create the database
Insert picture description here
ps:ef code first method is to use code to automatically generate the database and view

! ! ! 15. When using the view template Create or Edit to design a view, Lambda will be used by default

Insert picture description here
16. View templates cannot be used for partial views. (Yes right)
Insert picture description here

17. In the .NET MVC project, each model object is mapped to a relationship (referring to a database table)
Insert picture description here
ps: each model is a table

18. The EF framework uses ID or id as the model primary key by default.
Insert picture description here
19. To build a model in the EF framework, there must be a primary key . The primary key can be specified by Key (it is correct ).
Insert picture description here
20. For the safety of website data, it needs to be submitted to the user Data validation
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44575911/article/details/112089323