Skip to content

Expression in the SQL tree does not have a type mapping assigned #33582

@edamascus

Description

@edamascus

The following query was working fine in EF Core 7:

string[] values = new[] {"one", "two", "three", "four"};

var query = (from item in _context.items
             let value = values[item.value]
             select new {item.id, value}).ToList();

However, after upgrading to EF Core 8, the following exception is thrown:

System.InvalidOperationException: Expression '' in the SQL tree does not have a type mapping assigned.

I checked the breaking changes documentation and I am running SQL Server 2022 with compatibility level set for my database to 160.

What am I missing here?

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions