Skip to content

Cast inside aggregate (e.g. int → long) cannot be translated #14851

Closed
@AlekseyMartynov

Description

@AlekseyMartynov

Any chance this can be fixed in 2.x?

dbSet
    .GroupBy(i => 1)
    .Select(g => new {
        c = g.Count(),
        s = g.Sum(i => (long)i.Int32Prop)
    })
    .ToArray();
Error generated for warning 'Microsoft.EntityFrameworkCore.Query.QueryClientEvaluationWarning:
The LINQ expression 'GroupBy(1, [i])' could not be translated and will be evaluated locally.' 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions