View Source
Class ContentTypeService
Represents the ContentType Service, which is an easy access to operations involving IContentType
Assembly: Umbraco.Core.dll
Syntax
public class ContentTypeService : ContentTypeServiceBase<IContentTypeRepository, IContentType>, IContentTypeService, IContentTypeBaseService<IContentType>, IContentTypeBaseService, IService
Constructors
View Source
ContentTypeService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IContentService, IContentTypeRepository, IAuditRepository, IDocumentTypeContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection)
Declaration
[Obsolete("Use the non-obsolete constructor instead. Scheduled removal in v19.")]
public ContentTypeService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IContentService contentService, IContentTypeRepository repository, IAuditRepository auditRepository, IDocumentTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters)
Parameters
View Source
ContentTypeService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IContentService, IContentTypeRepository, IAuditRepository, IAuditService, IDocumentTypeContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection)
Declaration
[Obsolete("Use the non-obsolete constructor instead. Scheduled removal in v19.")]
public ContentTypeService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IContentService contentService, IContentTypeRepository repository, IAuditRepository auditRepository, IAuditService auditService, IDocumentTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters)
Parameters
View Source
ContentTypeService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IContentService, IContentTypeRepository, IAuditRepository, IAuditService, IDocumentTypeContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection, ITemplateService)
Declaration
[Obsolete("Use the non-obsolete constructor instead. Scheduled removal in v19.")]
public ContentTypeService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IContentService contentService, IContentTypeRepository repository, IAuditRepository auditRepository, IAuditService auditService, IDocumentTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters, ITemplateService templateService)
Parameters
View Source
ContentTypeService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IContentService, IContentTypeRepository, IAuditService, IDocumentTypeContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection)
Declaration
[Obsolete("Use the non-obsolete constructor. Scheduled for removal in Umbraco 19.")]
public ContentTypeService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IContentService contentService, IContentTypeRepository repository, IAuditService auditService, IDocumentTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters)
Parameters
View Source
ContentTypeService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IContentService, IContentTypeRepository, IAuditService, IDocumentTypeContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection, ITemplateService)
Declaration
public ContentTypeService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IContentService contentService, IContentTypeRepository repository, IAuditService auditService, IDocumentTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters, ITemplateService templateService)
Parameters
Properties
View Source
ContainedObjectType
Declaration
protected override Guid ContainedObjectType { get; }
Property Value
View Source
ReadLockIds
Declaration
protected override int[] ReadLockIds { get; }
Property Value
View Source
WriteLockIds
Declaration
protected override int[] WriteLockIds { get; }
Property Value
Methods
View Source
CreateTemplateAsync(Guid, string, string, bool, Guid)
Creates a template for the given content type.
Declaration
public 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
View Source
DeleteItemsOfTypes(IEnumerable<int>)
Declaration
protected override void DeleteItemsOfTypes(IEnumerable<int> typeIds)
Parameters
| Type |
Name |
Description |
| IEnumerable<int> |
typeIds |
|
View Source
GetAllContentTypeAliases(params Guid[])
Gets all content type aliases across content, media and member types.
Declaration
public IEnumerable<string> GetAllContentTypeAliases(params Guid[] guids)
Parameters
| Type |
Name |
Description |
| Guid[] |
guids |
Optional object types guid to restrict to content, and/or media, and/or member types.
|
Returns
| Type |
Description |
| IEnumerable<string> |
All content type aliases.
|
View Source
GetAllContentTypeIds(string[])
Gets all content type id for aliases across content, media and member types.
Declaration
public IEnumerable<int> GetAllContentTypeIds(string[] aliases)
Parameters
| Type |
Name |
Description |
| string[] |
aliases |
Aliases to look for.
|
Returns
| Type |
Description |
| IEnumerable<int> |
All content type ids.
|
View Source
GetAllPropertyTypeAliases()
Gets all property type aliases across content, media and member types.
Declaration
public IEnumerable<string> GetAllPropertyTypeAliases()
Returns
| Type |
Description |
| IEnumerable<string> |
All property type aliases.
|
View Source
GetByQueryAsync(IQuery<IContentType>, CancellationToken)
Declaration
public Task<IEnumerable<IContentType>> GetByQueryAsync(IQuery<IContentType> query, CancellationToken cancellationToken)
Parameters
Returns
View Source
GetContentTypeChangedNotification(IEnumerable<ContentTypeChange<IContentType>>, EventMessages)
Declaration
protected override ContentTypeChangeNotification<IContentType> GetContentTypeChangedNotification(IEnumerable<ContentTypeChange<IContentType>> changes, EventMessages eventMessages)
Parameters
Returns
View Source
GetContentTypeRefreshedNotification(IEnumerable<ContentTypeChange<IContentType>>, EventMessages)
The purpose of this notification being published within the transaction is so that listeners can perform database
operations from within the same transaction and guarantee data consistency so that if anything goes wrong
the entire transaction can be rolled back. This is used by Nucache.
Declaration
protected override ContentTypeRefreshNotification<IContentType> GetContentTypeRefreshedNotification(IEnumerable<ContentTypeChange<IContentType>> changes, EventMessages eventMessages)
Parameters
Returns
View Source
GetDeletedNotification(IEnumerable<IContentType>, EventMessages)
Declaration
protected override DeletedNotification<IContentType> GetDeletedNotification(IEnumerable<IContentType> items, EventMessages eventMessages)
Parameters
Returns
View Source
GetDeletingNotification(IEnumerable<IContentType>, EventMessages)
Declaration
protected override DeletingNotification<IContentType> GetDeletingNotification(IEnumerable<IContentType> items, EventMessages eventMessages)
Parameters
Returns
View Source
GetDeletingNotification(IContentType, EventMessages)
Declaration
protected override DeletingNotification<IContentType> GetDeletingNotification(IContentType item, EventMessages eventMessages)
Parameters
Returns
View Source
GetMovedNotification(IEnumerable<MoveEventInfo<IContentType>>, EventMessages)
Declaration
protected override MovedNotification<IContentType> GetMovedNotification(IEnumerable<MoveEventInfo<IContentType>> moveInfo, EventMessages eventMessages)
Parameters
Returns
View Source
GetMovingNotification(MoveEventInfo<IContentType>, EventMessages)
Declaration
protected override MovingNotification<IContentType> GetMovingNotification(MoveEventInfo<IContentType> moveInfo, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavedNotification(IEnumerable<IContentType>, EventMessages)
Declaration
protected override SavedNotification<IContentType> GetSavedNotification(IEnumerable<IContentType> items, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavedNotification(IContentType, EventMessages)
Declaration
protected override SavedNotification<IContentType> GetSavedNotification(IContentType item, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavingNotification(IEnumerable<IContentType>, EventMessages)
Declaration
protected override SavingNotification<IContentType> GetSavingNotification(IEnumerable<IContentType> items, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavingNotification(IContentType, EventMessages)
Declaration
protected override SavingNotification<IContentType> GetSavingNotification(IContentType item, EventMessages eventMessages)
Parameters
Returns