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:
Sebastien Ros
2012-08-17 16:31:42 -07:00
parent 2fee00e1c5
commit 3fdfead729
9 changed files with 128 additions and 84 deletions

View File

@@ -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();
}