Interface IContentTypeService
Manages IContentType objects.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IContentTypeService : IContentTypeBaseService<IContentType>, IContentTypeBaseService, IService
Methods
View SourceCreateTemplateAsync(Guid, string, string, bool, Guid)
Creates a template for the given content type.
Declaration
Task<Attempt<Guid?, ContentTypeOperationStatus>> CreateTemplateAsync(Guid contentTypeKey, string templateName, string templateAlias, bool isDefaultTemplate, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentTypeKey | The content type key. |
| string | templateName | The name of the template to create. |
| string | templateAlias | The alias of the template to create. |
| bool | isDefaultTemplate | Whether to set the template as the default template for the content type. |
| Guid | userKey | The key of the user performing the operation. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<Guid?, ContentTypeOperationStatus>> | An attempt containing the template's key if successful, or an error status if not. |
GetAllContentTypeAliases(params Guid[])
Gets all content type aliases
Declaration
IEnumerable<string> GetAllContentTypeAliases(params Guid[] objectTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid[] | objectTypes | If this list is empty, it will return all content type aliases for media, members and content, otherwise it will only return content type aliases for the object types specified |
Returns
| Type | Description |
|---|---|
| IEnumerable<string> |
GetAllContentTypeIds(string[])
Returns all content type Ids for the aliases given
Declaration
IEnumerable<int> GetAllContentTypeIds(string[] aliases)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | aliases |
Returns
| Type | Description |
|---|---|
| IEnumerable<int> |
GetAllPropertyTypeAliases()
Gets all property type aliases.
Declaration
IEnumerable<string> GetAllPropertyTypeAliases()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> |
GetByQueryAsync(IQuery<IContentType>, CancellationToken)
Declaration
Task<IEnumerable<IContentType>> GetByQueryAsync(IQuery<IContentType> query, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IQuery<IContentType> | query | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IContentType>> |