question

MarcoSalvatori-5288 avatar image
0 Votes"
MarcoSalvatori-5288 asked ·

Linq Error when migrate entityframeworkcore 2.2 to 3.0

Hello,
i am migrating from netcore 2.1 to 3.1. of a solution hosted on Azure.
I have encountered many errors due to entityframeworkcore 3.

Queries such as DBe.BmsListaInfrastructure.Where (e => e.Amministration == Administration) .ToList ();
they create errors!
The solution is to insert AsEnumerable () (DBe.BmsListaInfrastructure.AsEnumerable (). Where (e => e.Amministrazioni == Administration) .ToList ();)
Do I have to change them all or is there a quick way to adapt them?
Thanks

dotnet-entity-framework-core
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErikEJ avatar image
0 Votes"
ErikEJ answered ·

Adding AsEnumerable will pull the entire table - is that really what you want. Rewrite the query so it can be evaluated on the server.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarcoSalvatori-5288 avatar image
0 Votes"
MarcoSalvatori-5288 answered ·

is there a way to not rewrite the queries?
I have many ... I should retest everything ...
the problem is with 'singleordefault'...

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.