© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
21 replies
kaziux

GroupBy cannot be translated using

Hello I can't for example group data by month using one of class datetime attribute navigation property month
 var countryHolidays = await _db.Holidays
                .Where(x => x.Country.CountryCode == countryCode && x.HolidayDate.Year == year)
                .Include(x => x.Country)
               .GroupBy(x => new { 
                    Month = x.HolidayDate.Month
            }).ToListAsync();
 var countryHolidays = await _db.Holidays
                .Where(x => x.Country.CountryCode == countryCode && x.HolidayDate.Year == year)
                .Include(x => x.Country)
               .GroupBy(x => new { 
                    Month = x.HolidayDate.Month
            }).ToListAsync();
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ could not be translated
C#CC# / help
17mo ago
❔ best practices for updating objects using GroupBy
C#CC# / help
3y ago
CosmosDB Linq GroupBy
C#CC# / help
3y ago
✅ LINQ GroupBy error
C#CC# / help
4y ago