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.73k stars 3.18k forks source link

Parameter-specific evaluation in ParameterExtractor and compiled queries #19209

Open roji opened 4 years ago

roji commented 4 years ago

When executing normal queries, ParameterExtractor is invoked every time, and performs evaluations on parameters. However, with compiled queries the ParameterExtractor is invoked only once, so these evaluations do not take place. This raises some questions:

Originally discussed in https://github.com/aspnet/EntityFrameworkCore/pull/19189#discussion_r354852354

smitpatel commented 4 years ago

We could make client-side evaluation for compiled queries work by having ParameterExtractor register evaluations as lambdas to be invoked each time a query is executed.

That is what true funcletizer is.

roji commented 4 years ago

I guess I finally figured it out then :)

smitpatel commented 4 years ago

This would also enable using properties over DbContext inside query.