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

View: 17092|Reply: 2

[Communication] EF rollup function usage precautions Max()/Min(), etc

[Copy link]
Posted on 4/15/2019 4:52:06 PM | | | |

1. The maximum value of the string type

1. The maximum value of the string type is the same as the last dictionary sort of the database, if there is a return of null


2. The maximum value of the number type

1. The maximum value of the number type is the same as the last one sorted by the database field, if no data throws an exception.

Number type, the data obtained from the condition does not throw exceptions
Additional information: The cast to the value type "System.Decimal" failed because the materialized value was null.
The generic parameter or query of the result type must be of a type that can be null.

Solution 1 (recommended):

The generated SQL is as follows:

Solution 2:

Solution 3:







Previous:Million annual salary: Data Algorithm Engineer (understanding high-performance computing acceleration architecture、...
Next:PowerDesigner 16.5 Chinese cracked version installation tutorial (including installation files and Chinese packages、...
 Landlord| Posted on 4/15/2019 4:55:03 PM |
linq sum source is empty
https://www.itsvse.com/thread-4561-1-1.html
(Source: Architect_Programmer)
 Landlord| Posted on 4/15/2019 4:55:15 PM |
Cast to value type "System.Decimal" failed...
https://www.itsvse.com/thread-7223-1-1.html
(Source: Architect_Programmer)
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