Class ContextualPublishedContentCache
Provides access to cached documents in a specified context.
Namespace:System.Dynamic.ExpandoObject
Assembly:umbraco.dll
Syntax
public class ContextualPublishedContentCache : ContextualPublishedCache<IPublishedContentCache>
Methods
GetById(Boolean, Guid)
Declaration
public override IPublishedContent GetById(bool preview, Guid contentKey)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | |
System.Guid | contentKey |
Returns
Type | Description |
---|---|
IPublishedContent |
GetByRoute(Boolean, String, Nullable<Boolean>)
Gets content identified by a route.
Declaration
public IPublishedContent GetByRoute(bool preview, string route, bool ? hideTopLevelNode = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | route | The route |
System.Nullable<System.Boolean> | hideTopLevelNode | A value forcing the HideTopLevelNode setting. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
A valid route is either a simple path eg /foo/bar/nil
or a root node id and a path, eg 123/foo/bar/nil
.
GetByRoute(String, Nullable<Boolean>)
Gets content identified by a route.
Declaration
public IPublishedContent GetByRoute(string route, bool ? hideTopLevelNode = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | route | The route |
System.Nullable<System.Boolean> | hideTopLevelNode | A value forcing the HideTopLevelNode setting. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
A valid route is either a simple path eg /foo/bar/nil
or a root node id and a path, eg 123/foo/bar/nil
.
Considers published or unpublished content depending on context.
GetRouteById(Boolean, Int32)
Gets the route for a content identified by its unique identifier.
Declaration
public string GetRouteById(bool preview, int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
System.String | The route. |
Remarks
Considers published or unpublished content depending on context.
GetRouteById(Int32)
Gets the route for a content identified by its unique identifier.
Declaration
public string GetRouteById(int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
System.String | The route. |
Remarks
Considers published or unpublished content depending on context.