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

ef core 3 linq query #18037

Closed
azizkazdal opened this issue Sep 25, 2019 · 1 comment
Closed

ef core 3 linq query #18037

azizkazdal opened this issue Sep 25, 2019 · 1 comment

Comments

@azizkazdal
Copy link

Below code works fine at ef core 2.2 bu not working on ef core 3

 var items = (from asset in Context.Assets
                         join assetCategory in Context.AssetCategories on asset.CategoryId equals assetCategory.Id
                         group assetCategory by assetCategory.Id into assetCategories
                         select new AssetCategorySummary
                         {
                             CategoryId = assetCategories.Key,
                             CategoryName = assetCategories.Select(p => p.CategoryName).FirstOrDefault(),
                             TotalAsset = assetCategories.Count()
                         }).ToListAsync();

the error I am getting

Processing of the LINQ expression 'AsQueryable<string>(Select<AssetCategory, string>(
    source: NavigationTreeExpression
        Value: default(IGrouping<Guid, AssetCategory>)
        Expression: (Unhandled parameter: e), 
    selector: (p) => p.CategoryName))' by 'NavigationExpandingExpressionVisitor' 
failed. This may indicate either a bug or a limitation in EF Core. 
See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
@smitpatel
Copy link
Contributor

Grouping.Select.FirstOrDefault is being tracked by #13805

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants