mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-22 03:37:25 +08:00
Improving Content Query
Custom extensions IStartingWith, IsEndingWith, IsContaining New IContentQuery.WhereAny to prevent the limitation from QueryOver to handle IEnumerable.Any() in expression queries --HG-- branch : 1.x
This commit is contained in:
@@ -143,8 +143,8 @@ namespace Orchard.Tags.Services {
|
||||
|
||||
public int GetTaggedContentItemCount(int tagId, VersionOptions options) {
|
||||
return _orchardServices.ContentManager
|
||||
.HqlQuery<TagsPart>()
|
||||
.Where(tpr => tpr.ContentPartRecord<TagsPartRecord>().Property("Tags", "tags"), x => x.Eq("TagRecord.Id", tagId))
|
||||
.Query<TagsPart, TagsPartRecord>()
|
||||
.WhereAny(part => part.Tags, tag => tag.Id == tagId)
|
||||
.Count();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user