Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification Question #1

Closed
christophwille opened this issue Jan 29, 2024 · 1 comment
Closed

Clarification Question #1

christophwille opened this issue Jan 29, 2024 · 1 comment

Comments

@christophwille
Copy link

        var blog = sqlServerDb.Blogs
            .OrderBy(b => b.BlogId)
            .First();

vs

        var query= sqlServerDb.Blogs
            .OrderBy(b => b.BlogId);

        var blog = query.First();

The latter one shows the visualizer - this is the expected behavior, correct? (query must be separate from projection)

@Giorgi
Copy link
Owner

Giorgi commented Jan 29, 2024

Correct, it isn't possible to inspect queries that return a project (First, Max, Sum, etc). This visualizer can show plans only for IQueryable instances.

For such cases, you can separate queries like in your example but it won't give the real query/plan. When you apply First, Sum, or other projections the query and hence the plan will be different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants