#20909: Optimizing some queries for performance

Work Item: 20909
This commit is contained in:
Sebastien Ros
2014-08-28 13:52:59 -07:00
parent 4fe5653fef
commit af0ea26f85
3 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ namespace Orchard.Projections.Drivers {
Items = part.Items,
Skip = part.Skip,
QueryRecordId = part.QueryPartRecord == null ? "-1" : part.QueryPartRecord.Id.ToString(),
Queries = Services.ContentManager.Query<QueryPart>().Join<TitlePartRecord>().OrderBy(x => x.Title).List(),
Queries = Services.ContentManager.Query<QueryPart, QueryPartRecord>().Join<TitlePartRecord>().OrderBy(x => x.Title).List(),
};
return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix);

View File

@@ -249,7 +249,7 @@ namespace Orchard.Projections.Drivers {
// populating the list of queries and layouts
var layouts = _projectionManager.DescribeLayouts().SelectMany(x => x.Descriptors).ToList();
model.QueryRecordEntries = Services.ContentManager.Query<QueryPart>().Join<TitlePartRecord>().OrderBy(x => x.Title).List()
model.QueryRecordEntries = Services.ContentManager.Query<QueryPart, QueryPartRecord>().Join<TitlePartRecord>().OrderBy(x => x.Title).List()
.Select(x => new QueryRecordEntry {
Id = x.Id,
Name = x.Name,

View File

@@ -53,7 +53,7 @@ namespace Orchard.Widgets.Filters {
// Once the Rule Engine is done:
// Get Layers and filter by zone and rule
IEnumerable<LayerPart> activeLayers = _orchardServices.ContentManager.Query<LayerPart>().ForType("Layer").List();
IEnumerable<LayerPart> activeLayers = _orchardServices.ContentManager.Query<LayerPart, LayerPartRecord>().ForType("Layer").List();
var activeLayerIds = new List<int>();
foreach (var activeLayer in activeLayers) {