Linq Error when migrate entityframeworkcore 2.2 to 3.0

Marco Salvatori 191 Reputation points

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?

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

2 answers

Sort by: Most helpful
  1. ErikEJ 341 Reputation points MVP

    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

    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