Open msmolka opened 5 years ago
Notes from triage: currently composition in this way (where a function returning an IQueryable is present in the expression tree rather than everything being part of the same tree) is not supported. We could potentially make this work (for compiled queries and in other places) but it's not something we are likely to do without more feedback. One reason for this is that explicitly compiled queries often don't provide noticeably faster performance than normal, auto-compiled queries.
@msmolka Are you using compiled queries because of a significant performance improvement? If so, can you provide details, including your performance numbers?
Hello, I'm trying different approach to avoid lag during startup (first run). Sometimes 5 second delay for first entity access is annoying. So I'm trying to find the way to improve first experience. I'm already using pooling, but still first one is longer.
@msmolka You might be experiencing the delay caused by model building. You can access context.Model
before performing a query to force the model to build and measure it separately.
I have query part defined as static query, to reuse in multiple places of code. When I running static query directly all is working properly, however when I'm trying to use it in
EF.CompileQuery
it throws exception. Putting the same part directly to compilation part work as expected. But then DRY principle is lost. And I have to repeat myself many times.Steps to reproduce
Following query:
Following code works:
This not:
It throws following exception:
Further technical details
EF Core version: 3.0 Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) Target framework: (.NET Core 3.0) Operating system: Windows 10 x64 IDE: (e.g. Visual Studio 2019 16.3.2)