mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
Fixing Count() queries
--HG-- branch : 1.x
This commit is contained in:
@@ -154,11 +154,14 @@ namespace Orchard.ContentManagement {
|
||||
|
||||
int Count() {
|
||||
var queryOver = BindItemVersionQueryOver();
|
||||
queryOver.ClearOrders();
|
||||
|
||||
queryOver.ApplyVersionOptionsRestrictions(_versionOptions);
|
||||
// clone the query so that it doesn't affect the current one
|
||||
var countQuery = queryOver.Clone();
|
||||
countQuery.ClearOrders();
|
||||
|
||||
return queryOver.Select(Projections.RowCount()).FutureValue<int>().Value;
|
||||
countQuery.ApplyVersionOptionsRestrictions(_versionOptions);
|
||||
|
||||
return countQuery.Select(Projections.RowCount()).FutureValue<int>().Value;
|
||||
}
|
||||
|
||||
IContentQuery<TPart> IContentQuery.ForPart<TPart>() {
|
||||
|
||||
Reference in New Issue
Block a user