Open alexwiese opened 5 years ago
The following throws an exception
People.Count();
An exception occurred while reading a database value. The expected type was 'System.Int32' but the actual value was of type 'System.Int64'
Workaround for now is to always use
LongCount()
instead.
FYI: You can use LongCount from Queryable class: https://docs.microsoft.com/en-us/dotnet/api/system.linq.queryable.longcount?view=net-5.0
For me LongCount worked as expected.
Sample:
var orderItemsCount = (int)orderItemsQuery.LongCount();
The following throws an exception
Workaround for now is to always use
LongCount()
instead.