Remix.run Logo
fabian2k 2 days ago

In EF Core this will almost certainly generate a query like "SELECT name FROM users WHERE id = 123 LIMIT 1;". The LINQ expression is transformed into SQL, and any expression that can't be transformed will cause an error to be thrown.

Certain methods like First() in this case materialize expressions. Only those trigger a DB query.