Skip to content

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

Open
AndriySvyryd with Copilot wants to merge 3 commits into
mainfrom
copilot/document-aggregate-functions
Open

Document aggregate queries and built-in function mapping#5460
AndriySvyryd with Copilot wants to merge 3 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.

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

3 participants