Merge pull request #5897 from paynecrl97/patch-1

Fixes 1+n db call issue
This commit is contained in:
Nicholas Mayne
2015-10-05 12:35:43 +02:00

View File

@@ -41,7 +41,7 @@ namespace Orchard.Widgets.Services{
// Once the Rule Engine is done:
// Get Layers and filter by zone and rule
// NOTE: .ForType("Layer") is faster than .Query<LayerPart, LayerPartRecord>()
var activeLayers = _orchardServices.ContentManager.Query<LayerPart>().ForType("Layer").List();
var activeLayers = _orchardServices.ContentManager.Query<LayerPart>().WithQueryHints(new QueryHints().ExpandParts<LayerPart>()).ForType("Layer").List();
var activeLayerIds = new List<int>();
foreach (var activeLayer in activeLayers) {
@@ -59,4 +59,4 @@ namespace Orchard.Widgets.Services{
return activeLayerIds.ToArray();
}
}
}
}