Class ContextualPublishedCache
Provides access to cached contents in a specified context.
Inheritance
Namespace:System.Dynamic.ExpandoObject
Assembly:umbraco.dll
Syntax
public abstract class ContextualPublishedCache
Constructors
ContextualPublishedCache(UmbracoContext)
Initializes a new instance of the ContextualPublishedCache with a context.
Declaration
protected ContextualPublishedCache(UmbracoContext umbracoContext)
Parameters
Type | Name | Description |
---|---|---|
UmbracoContext | umbracoContext | The context. |
Fields
UmbracoContext
Declaration
protected readonly UmbracoContext UmbracoContext
Field Value
Type | Description |
---|---|
UmbracoContext |
Properties
XPathNavigatorIsNavigable
Gets a value indicating whether GetXPathNavigator
returns an XPathNavigator
and that navigator is a NavigableNavigator
.
Declaration
public abstract bool XPathNavigatorIsNavigable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
GetAtRoot()
Gets content at root.
Declaration
public IEnumerable<IPublishedContent> GetAtRoot()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The contents. |
Remarks
Considers published or unpublished content depending on context.
GetAtRoot(Boolean)
Gets contents at root.
Declaration
public abstract IEnumerable<IPublishedContent> GetAtRoot(bool preview)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The contents. |
GetById(Boolean, Guid)
Declaration
public virtual IPublishedContent GetById(bool preview, Guid contentKey)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | |
System.Guid | contentKey |
Returns
Type | Description |
---|---|
IPublishedContent |
GetById(Boolean, Int32)
Gets a content identified by its unique identifier.
Declaration
public abstract IPublishedContent GetById(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 |
---|---|
IPublishedContent | The content, or null. |
GetById(Guid)
Gets a content identified by its unique identifier.
Declaration
public IPublishedContent GetById(Guid contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on context.
GetById(Int32)
Gets a content identified by its unique identifier.
Declaration
public IPublishedContent GetById(int contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on context.
GetByXPath(Boolean, String, XPathVariable[])
Gets content resulting from an XPath query.
Declaration
public abstract IEnumerable<IPublishedContent> GetByXPath(bool preview, string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The contents. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
GetByXPath(Boolean, XPathExpression, XPathVariable[])
Gets content resulting from an XPath query.
Declaration
public abstract IEnumerable<IPublishedContent> GetByXPath(bool preview, XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The contents. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
GetByXPath(String, XPathVariable[])
Gets content resulting from an XPath query.
Declaration
public IEnumerable<IPublishedContent> GetByXPath(string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The contents. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
Considers published or unpublished content depending on context.
GetByXPath(XPathExpression, XPathVariable[])
Gets content resulting from an XPath query.
Declaration
public IEnumerable<IPublishedContent> GetByXPath(XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPublishedContent> | The contents. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
Considers published or unpublished content depending on context.
GetSingleByXPath(Boolean, String, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
public abstract IPublishedContent GetSingleByXPath(bool preview, string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
GetSingleByXPath(Boolean, XPathExpression, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
public abstract IPublishedContent GetSingleByXPath(bool preview, XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
GetSingleByXPath(String, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
public IPublishedContent GetSingleByXPath(string xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.String | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
Considers published or unpublished content depending on context.
GetSingleByXPath(XPathExpression, XPathVariable[])
Gets a content resulting from an XPath query.
Declaration
public IPublishedContent GetSingleByXPath(XPathExpression xpath, params XPathVariable[] vars)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XPath.XPathExpression | xpath | The XPath query. |
XPathVariable[] | vars | Optional XPath variables. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
If is null
, or is empty, or contains only one single
value which itself is null
, then variables are ignored.
The XPath expression should reference variables as $var
.
Considers published or unpublished content depending on context.
GetXPathNavigator()
Gets an XPath navigator that can be used to navigate content.
Declaration
public XPathNavigator GetXPathNavigator()
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | The XPath navigator. |
Remarks
Considers published or unpublished content depending on context.
GetXPathNavigator(Boolean)
Gets an XPath navigator that can be used to navigate content.
Declaration
public abstract XPathNavigator GetXPathNavigator(bool preview)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Returns
Type | Description |
---|---|
System.Xml.XPath.XPathNavigator | The XPath navigator. |
HasContent()
Gets a value indicating whether the underlying non-contextual cache contains content.
Declaration
public bool HasContent()
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the underlying non-contextual cache contains content. |
Remarks
Considers published or unpublished content depending on context.
HasContent(Boolean)
Gets a value indicating whether the underlying non-contextual cache contains content.
Declaration
public abstract bool HasContent(bool preview)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the underlying non-contextual cache contains content. |