This article is a mirror article of machine translation, please click here to jump to the original article.

View: 21915|Reply: 1

[Source] ef sorts pagination first, and the order of the results of the left join query is disordered

[Copy link]
Posted on 10/26/2018 11:11:29 AM | | | |
Today, on the website query interface, according to the descending order of the primary key ID, it is found that the data list is incorrect, and the code is as follows:

Generated SQL statement:

Outcome:


The numbering order is all messy


Solution:

First join, then order by and then paginate

Code:

Generate SQL statements:

Outcome:






Previous:Notes on "Treat Time as a Friend"
Next:Illustrated Latin Hardware Detection Tool v1.0.0.5 Green Pure Edition
 Landlord| Posted on 10/26/2018 3:32:19 PM |
.net EF Join correlation table paginated queries

The second and third parameters in the join are the fields associated with the two tables   

If you don't write the Model name after the fourth parameter new, the system will automatically generate a list type with fields



Whether the join part is an inner join or a left join, EF will automatically generate the corresponding SQL based on the query conditions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com