Fixes 1+n db call issue

Adds
This commit is contained in:
Chris Payne
2015-09-29 01:24:39 +01:00
parent 9bafa7ff9a
commit 90feec6369

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