Class PublishedContentTypeCache
Represents a content type cache.
Inheritance
Namespace: Umbraco.Cms.Core.PublishedCache
Assembly: Umbraco.Infrastructure.dll
Syntax
public class PublishedContentTypeCache : IPublishedContentTypeCache
Remarks
This cache is not snapshotted, so it refreshes any time things change.
Constructors
View SourcePublishedContentTypeCache(IContentTypeService?, IMediaTypeService?, IMemberTypeService?, IPublishedContentTypeFactory, ILogger<PublishedContentTypeCache>)
Initializes a new instance of the PublishedContentTypeCache class.
Declaration
public PublishedContentTypeCache(IContentTypeService? contentTypeService, IMediaTypeService? mediaTypeService, IMemberTypeService? memberTypeService, IPublishedContentTypeFactory publishedContentTypeFactory, ILogger<PublishedContentTypeCache> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IContentTypeService | contentTypeService | The service used to manage content types. Typically injected as a dependency. |
| IMediaTypeService | mediaTypeService | The service used to manage media types. Typically injected as a dependency. |
| IMemberTypeService | memberTypeService | The service used to manage member types. Typically injected as a dependency. |
| IPublishedContentTypeFactory | publishedContentTypeFactory | The factory used to create published content types. |
| ILogger<PublishedContentTypeCache> | logger | The logger used for logging cache-related events and errors. |
Remarks
default ctor
Methods
View SourceClearAll()
Clears all cached content types.
Declaration
public void ClearAll()
ClearByDataTypeId(int)
Removes and returns all published content types that have at least one property using the specified data type ID.
Declaration
public IEnumerable<IPublishedContentType> ClearByDataTypeId(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The unique identifier of the data type whose associated content types should be cleared. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IPublishedContentType> | An enumerable of IPublishedContentType instances that were removed from the cache. |
ClearContentType(int)
Clears a cached content type.
Declaration
public void ClearContentType(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | An identifier. |
ClearContentTypes(IEnumerable<int>)
Clears the cached content types for the specified IDs.
Declaration
public void ClearContentTypes(IEnumerable<int> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<int> | ids | The collection of content type IDs to clear from the cache. |
ClearDataType(int)
Clears all cached content types referencing a data type.
Declaration
public void ClearDataType(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | A data type identifier. |
Get(PublishedItemType, Guid)
Gets a published content type.
Declaration
public IPublishedContentType Get(PublishedItemType itemType, Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| PublishedItemType | itemType | An item type. |
| Guid | key | An key. |
Returns
| Type | Description |
|---|---|
| IPublishedContentType | The published content type corresponding to the item key. |
Get(PublishedItemType, int)
Gets a published content type.
Declaration
public IPublishedContentType Get(PublishedItemType itemType, int id)
Parameters
| Type | Name | Description |
|---|---|---|
| PublishedItemType | itemType | An item type. |
| int | id | An identifier. |
Returns
| Type | Description |
|---|---|
| IPublishedContentType | The published content type corresponding to the item type and identifier. |
Get(PublishedItemType, string)
Gets a published content type.
Declaration
public IPublishedContentType Get(PublishedItemType itemType, string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| PublishedItemType | itemType | An item type. |
| string | alias | An alias. |
Returns
| Type | Description |
|---|---|
| IPublishedContentType | The published content type corresponding to the item type and alias. |