diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs index a82fa1113e..c2e5aacd7b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs @@ -88,11 +88,10 @@ public class EfCoreTagRepository : EfCoreRepository return await (from tag in await GetDbSetAsync() join entityTag in (await GetDbContextAsync()).Set() on tag.Id equals entityTag.TagId where tag.EntityType == entityType - select new { tag, entityTag } into tagEntityTag - group tagEntityTag by tagEntityTag.entityTag.TagId + group tag by tag.Id into g orderby g.Count() descending - select new PopularTag(g.Key, g.First().tag.Name, g.Count())) + select new PopularTag(g.Key, g.First().Name, g.Count())) .Take(maxCount) .ToListAsync(cancellationToken: GetCancellationToken(cancellationToken)); }