From 5c7dadfa920404fe3590f76372793b36bacfe10d Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Mon, 20 Aug 2012 15:10:40 -0700 Subject: [PATCH] Updating TagsService to use WhereAny() --HG-- branch : 1.x --- .../Modules/Orchard.Tags/Services/TagService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs index 4a93f6199..bc090f338 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs @@ -131,9 +131,9 @@ namespace Orchard.Tags.Services { public IEnumerable GetTaggedContentItems(int tagId, int skip, int take, VersionOptions options) { return _orchardServices.ContentManager - .HqlQuery() - .Where(tpr => tpr.ContentPartRecord().Property("Tags", "tags"), x => x.Eq("TagRecord.Id", tagId)) - .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("CreatedUtc")) + .Query() + .WhereAny(part => part.Tags, tag => tag.TagRecord.Id == tagId) + .Join().OrderByDescending(x => x.CreatedUtc) .Slice(skip, take); } @@ -144,7 +144,7 @@ namespace Orchard.Tags.Services { public int GetTaggedContentItemCount(int tagId, VersionOptions options) { return _orchardServices.ContentManager .Query() - .WhereAny(part => part.Tags, tag => tag.Id == tagId) + .WhereAny(part => part.Tags, tag => tag.TagRecord.Id == tagId) .Count(); }