Skip to content

Document aggregate queries and built-in function mapping - #5460

Merged
cincuranet merged 5 commits into
mainfrom
copilot/document-aggregate-functions
Aug 31, 2026
Merged

Document aggregate queries and built-in function mapping#5460
cincuranet merged 5 commits into
mainfrom
copilot/document-aggregate-functions

Conversation

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

EF Core lacked consolidated guidance for aggregate projections, composed aggregate inputs, and provider-specific top-level aggregates. Built-in database function mapping via IsBuiltIn was also undocumented.

  • Aggregate queries
    • Document GroupBy projections with filtering, ordering, and distinct inputs.
    • Show the constant-group workaround for provider-specific top-level aggregates.
    • Note that aggregate UDF mapping is unsupported.
var standardDeviation = context.Posts
    .GroupBy(_ => 1)
    .Select(g => EF.Functions.StandardDeviationSample(g.Select(p => p.Rating)))
    .FirstOrDefault();
  • Function mapping

    • Document fluent .IsBuiltIn() and [DbFunction(IsBuiltIn = true)] configuration.
    • Add a corresponding sample.
  • Provider references

    • Link SQL Server and SQLite aggregate translation tables to the conceptual guidance.

Copilot AI linked an issue Aug 19, 2026 that may be closed by this pull request
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Document aggregate functions in EF Core Document aggregate queries and built-in function mapping Aug 19, 2026
Copilot AI requested a review from AndriySvyryd August 19, 2026 23:26
@AndriySvyryd
AndriySvyryd requested a balanced review from Copilot August 20, 2026 00:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents aggregate query composition, top-level aggregate workarounds, and built-in database function mapping.

Changes:

  • Adds aggregate query guidance and examples.
  • Documents IsBuiltIn configuration with a sample.
  • Cross-links SQL Server and SQLite provider references.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
samples/core/Querying/UserDefinedFunctionMapping/Model.cs Adds built-in function mapping sample.
entity-framework/core/querying/user-defined-function-mapping.md Documents fluent and attribute configuration.
entity-framework/core/querying/complex-query-operators.md Adds aggregate query guidance.
entity-framework/core/providers/sqlite/functions.md Links conceptual aggregate guidance.
entity-framework/core/providers/sql-server/functions.md Links conceptual aggregate guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread entity-framework/core/providers/sql-server/functions.md
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@cincuranet

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

…egate-functions

# Conflicts:
#	entity-framework/core/querying/user-defined-function-mapping.md
#	samples/core/Querying/UserDefinedFunctionMapping/Model.cs

Co-authored-by: cincuranet <4540597+cincuranet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 31, 2026 11:04

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved in a4dc721 by merging main and reconciling the two IsBuiltIn sections in user-defined-function-mapping.md and Model.cs (fluent IsBuiltIn/attribute example kept alongside the new DbFunctionAttribute/store-type section).

Copilot AI requested a review from cincuranet August 31, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread samples/core/Querying/UserDefinedFunctionMapping/Model.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 31, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

entity-framework/core/querying/complex-query-operators.md:132

  • This example includes ordered aggregate inputs, a feature introduced in EF Core 11, but the conceptual page presents it without the required preview/version notice. Readers using EF Core 10 or earlier may therefore expect OrderedTitles to translate even though the provider tables mark ordered aggregation as EF Core 11. Add the preview note before introducing these composed forms.
Some aggregate functions allow their input to be composed. Depending on the provider, `Where` can filter the input, `OrderBy` can specify its ordering, and `Distinct` can remove duplicates. The following query illustrates these shapes:
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@cincuranet
cincuranet enabled auto-merge (squash) August 31, 2026 11:20
@cincuranet
cincuranet merged commit f08db84 into main Aug 31, 2026
6 checks passed
@cincuranet
cincuranet deleted the copilot/document-aggregate-functions branch August 31, 2026 11:26
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

Successfully merging this pull request may close these issues.

Document aggregate functions Document new IsBuiltIn API and property on DbFunctionAttribute

5 participants