dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.81k stars 3.2k forks source link

AOT: properly deal with NetTopologySuite objects in the materializer for AOT scenarios #33482

Open maumar opened 7 months ago

maumar commented 7 months ago

When producing a reader expression for NTS column, spatial type mappings use their own converters to modify the valueExpression in the CustomizeDataReaderExpression rather than going through normal converter process. Problem for AOT is that those converters capture SqlServerBytesReader object, which in turn uses NTS specific service (NtsGeometryServices) that we don't know about and can't effectively deal with using our liftable constant infra.

NTS is not supported in compiled model either so not huge priority, but we should deal with it in a proper way. For now just disable constant validation of that scenario by targeting a specific NTS type name, so not a very elegant solution.

AndriySvyryd commented 7 months ago

Related to #33517

maumar commented 4 months ago

in EF9 AOT will be experimental, some functionality will not work - this is one of the issues we will try to fix for 10