Describe the bug
System.InvalidOperationException when querying JSON data types with LINQ expressions that cannot be translated.
To Reproduce
Steps to reproduce the behavior:
- Create an entity with a JSON column
- Write a LINQ query that accesses the JSON property
- Execute the query
- Observe the error:
System.InvalidOperationException: The LINQ expression '$it => $it' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
Expected behavior
The LINQ query should execute successfully and return the expected results from JSON columns without requiring client evaluation.
Technical details (please complete the following information):
- Database server version: MySQL 8.0 +
- Operating system: Mac
- Pomelo.EntityFrameworkCore.MySql version: 8.0.3
- Other technical details: JSON data types, LINQ queries
Additional context
This issue occurs specifically when working with JSON data types and certain LINQ expressions that the provider cannot translate to SQL.
Describe the bug
System.InvalidOperationException when querying JSON data types with LINQ expressions that cannot be translated.
To Reproduce
Steps to reproduce the behavior:
System.InvalidOperationException: The LINQ expression '$it => $it' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.Expected behavior
The LINQ query should execute successfully and return the expected results from JSON columns without requiring client evaluation.
Technical details (please complete the following information):
Additional context
This issue occurs specifically when working with JSON data types and certain LINQ expressions that the provider cannot translate to SQL.