Adding support for fetching of element descriptors from the blue print element harvester.

The problem before this change was that the cache manager would cache an empty list of elements when trying to locate a blueprint element without specifying a content item.
The VaryByParam property allows additional control over the cache key.
This commit is contained in:
Sipke Schoorstra
2014-11-21 23:57:26 -08:00
parent 06ebab41fe
commit 1a9e5f4681
4 changed files with 8 additions and 6 deletions

View File

@@ -28,8 +28,8 @@ namespace Orchard.Layouts.Providers {
var blueprints = _elementBlueprintService.Value.GetBlueprints().ToArray();
var query =
from blueprint in blueprints
let describeContext = DescribeElementsContext.Empty
from blueprint in blueprints
let describeContext = new DescribeElementsContext { Content = context.Content, CacheVaryParam = "Blueprints"}
let baseElementDescriptor = _elementManager.Value.GetElementDescriptorByTypeName(describeContext, blueprint.BaseElementTypeName)
let baseElement = _elementManager.Value.ActivateElement(baseElementDescriptor)
select new ElementDescriptor(