Interface IPublishedCache
Provides access to cached contents.
Namespace: Umbraco.Cms.Core.PublishedCache
Assembly: Umbraco.Core.dll
Syntax
public interface IPublishedCache
Methods
View SourceGetAtRoot(Boolean, String)
Gets contents at root.
Declaration
IEnumerable<IPublishedContent> GetAtRoot(bool preview, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | culture | A culture. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
The value of preview
overrides defaults.
GetAtRoot(String)
Gets contents at root.
Declaration
IEnumerable<IPublishedContent> GetAtRoot(string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | culture | A culture. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
Remarks
Considers published or unpublished content depending on defaults.
GetByContentType(IPublishedContentType)
Gets contents of a given content type.
Declaration
IEnumerable<IPublishedContent> GetByContentType(IPublishedContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
IPublishedContentType | contentType | The content type. |
Returns
Type | Description |
---|---|
IEnumerable<IPublishedContent> | The contents. |
GetById(Guid)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(Guid contentId)
Parameters
Type | Name | Description |
---|---|---|
Guid | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
GetById(Boolean, Guid)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(bool preview, Guid contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Guid | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetById(Boolean, Int32)
Gets a content identified by its unique identifier.
Declaration
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. |
Remarks
The value of preview
overrides defaults.
GetById(Boolean, Udi)
Gets a content identified by its Udi identifier.
Declaration
IPublishedContent GetById(bool preview, Udi contentId)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
Udi | contentId | The content Udi identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
The value of preview
overrides defaults.
GetById(Int32)
Gets a content identified by its unique identifier.
Declaration
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 defaults.
GetById(Udi)
Gets a content identified by its unique identifier.
Declaration
IPublishedContent GetById(Udi contentId)
Parameters
Type | Name | Description |
---|---|---|
Udi | contentId | The content unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
Considers published or unpublished content depending on defaults.
GetContentType(Guid)
Gets a content type identified by its alias.
Declaration
IPublishedContentType GetContentType(Guid key)
Parameters
Type | Name | Description |
---|---|---|
Guid | key | The content type key. |
Returns
Type | Description |
---|---|
IPublishedContentType | The content type, or null. |
GetContentType(Int32)
Gets a content type identified by its unique identifier.
Declaration
IPublishedContentType GetContentType(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The content type unique identifier. |
Returns
Type | Description |
---|---|
IPublishedContentType | The content type, or null. |
GetContentType(String)
Gets a content type identified by its alias.
Declaration
IPublishedContentType GetContentType(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | The content type alias. |
Returns
Type | Description |
---|---|
IPublishedContentType | The content type, or null. |
Remarks
The alias is case-insensitive.
HasContent()
Gets a value indicating whether the cache contains published content.
Declaration
bool HasContent()
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the cache contains published content. |
Remarks
Considers published or unpublished content depending on defaults.
HasContent(Boolean)
Gets a value indicating whether the cache contains published content.
Declaration
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 cache contains published content. |
Remarks
The value of preview
overrides defaults.