Linq Error when migrate entityframeworkcore 2.2 to 3.0

Marco Salvatori 191 Reputation points
2020-12-15T18:27:20.663+00:00

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

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
695 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ErikEJ 341 Reputation points MVP
    2020-12-16T18:08:39.443+00:00

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

    0 comments No comments

  2. Marco Salvatori 191 Reputation points
    2020-12-17T14:25:01.817+00:00

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

    0 comments No comments