Closed IT-CASADO closed 8 months ago
Confirmed bug in main. The scenario above itself isn't a regression since hierarchyid support was introduced in 8.0, but the underlying issue is any transformation from OPENJSON with WITH to without WITH; this affects other scenarios as well (i.e. when the OPENJSON collection order needs to be preserved).
File a bug
Using a contains filter with HierarchyId in a spilt query scenario is throwing following exception:
Microsoft.Data.SqlClient.SqlException (0x80131904): CLR types cannot be used as column types in OPENJSON function with explicit schema. CLR types are not supported in WITH clause.
I found this related issue: #31930
Include your code
You can find a full working repro here: https://github.com/IT-CASADO/EfCoreBugs Please run the unit test: SplitQueryWithHierarchyIdFilter
Include stack traces
Include provider and version information
EF Core version: 8.0.1 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 8.0 Operating system: Windows IDE: Visual Studio 2022 17.8.5