View Source
Class ContentTypeServiceBase<TRepository, TItem>
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public abstract class ContentTypeServiceBase<TRepository, TItem> : ContentTypeServiceBase, IContentTypeBaseService<TItem>, IContentTypeBaseService, IService where TRepository : IContentTypeRepositoryBase<TItem> where TItem : class, IContentTypeComposition
Type Parameters
| Name |
Description |
| TRepository |
|
| TItem |
|
Constructors
View Source
ContentTypeServiceBase(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, TRepository, IAuditRepository, IEntityContainerRepository, IEntityRepository, IEventAggregator)
Declaration
protected ContentTypeServiceBase(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, TRepository repository, IAuditRepository auditRepository, IEntityContainerRepository containerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator)
Parameters
View Source
ContentTypeServiceBase(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, TRepository, IAuditRepository, IEntityContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver)
Declaration
protected ContentTypeServiceBase(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, TRepository repository, IAuditRepository auditRepository, IEntityContainerRepository containerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver)
Parameters
View Source
ContentTypeServiceBase(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, TRepository, IAuditRepository, IEntityContainerRepository, IEntityRepository, IEventAggregator, IUserIdKeyResolver, ContentTypeFilterCollection)
Declaration
protected ContentTypeServiceBase(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, TRepository repository, IAuditRepository auditRepository, IEntityContainerRepository containerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator, IUserIdKeyResolver userIdKeyResolver, ContentTypeFilterCollection contentTypeFilters)
Parameters
Properties
View Source
ContainedObjectType
Declaration
protected abstract Guid ContainedObjectType { get; }
Property Value
View Source
ContainerObjectType
Declaration
protected Guid ContainerObjectType { get; }
Property Value
View Source
ReadLockIds
Declaration
protected abstract int[] ReadLockIds { get; }
Property Value
| Type |
Description |
| System.Int32[] |
|
View Source
Repository
Declaration
protected TRepository Repository { get; }
Property Value
| Type |
Description |
| TRepository |
|
View Source
WriteLockIds
Declaration
protected abstract int[] WriteLockIds { get; }
Property Value
| Type |
Description |
| System.Int32[] |
|
Methods
View Source
CanDelete(TItem)
Declaration
protected virtual bool CanDelete(TItem item)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
Copy(TItem, Int32)
Declaration
public Attempt<OperationResult<MoveOperationStatusType, TItem>> Copy(TItem copying, int containerId)
Parameters
| Type |
Name |
Description |
| TItem |
copying |
|
| System.Int32 |
containerId |
|
Returns
View Source
Copy(TItem, String, String, TItem)
Declaration
public TItem Copy(TItem original, string alias, string name, TItem parent)
Parameters
| Type |
Name |
Description |
| TItem |
original |
|
| System.String |
alias |
|
| System.String |
name |
|
| TItem |
parent |
|
Returns
View Source
Copy(TItem, String, String, Int32)
Declaration
public TItem Copy(TItem original, string alias, string name, int parentId = -1)
Parameters
| Type |
Name |
Description |
| TItem |
original |
|
| System.String |
alias |
|
| System.String |
name |
|
| System.Int32 |
parentId |
|
Returns
View Source
CopyAsync(Guid, Nullable<Guid>)
Declaration
public async Task<Attempt<TItem, ContentTypeStructureOperationStatus>> CopyAsync(Guid key, Guid? containerKey)
Parameters
| Type |
Name |
Description |
| Guid |
key |
|
| System.Nullable<Guid> |
containerKey |
|
Returns
View Source
Count()
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
View Source
CreateAsync(TItem, Guid)
Declaration
public async Task<Attempt<ContentTypeOperationStatus>> CreateAsync(TItem item, Guid performingUserKey)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
| Guid |
performingUserKey |
|
Returns
View Source
CreateContainer(Int32, Guid, String, Int32)
Declaration
public Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, Guid key, string name, int userId = -1)
Parameters
| Type |
Name |
Description |
| System.Int32 |
parentId |
|
| Guid |
key |
|
| System.String |
name |
|
| System.Int32 |
userId |
|
Returns
View Source
Delete(TItem, Int32)
Declaration
public void Delete(TItem item, int userId = -1)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
| System.Int32 |
userId |
|
View Source
Delete(IEnumerable<TItem>, Int32)
Declaration
public void Delete(IEnumerable<TItem> items, int userId = -1)
Parameters
| Type |
Name |
Description |
| IEnumerable<TItem> |
items |
|
| System.Int32 |
userId |
|
View Source
DeleteAsync(Guid, Guid)
Declaration
public async Task<ContentTypeOperationStatus> DeleteAsync(Guid key, Guid performingUserKey)
Parameters
| Type |
Name |
Description |
| Guid |
key |
|
| Guid |
performingUserKey |
|
Returns
View Source
DeleteContainer(Int32, Int32)
Declaration
public Attempt<OperationResult> DeleteContainer(int containerId, int userId = -1)
Parameters
| Type |
Name |
Description |
| System.Int32 |
containerId |
|
| System.Int32 |
userId |
|
Returns
View Source
DeleteItemsOfTypes(IEnumerable<Int32>)
Declaration
protected abstract void DeleteItemsOfTypes(IEnumerable<int> typeIds)
Parameters
| Type |
Name |
Description |
| IEnumerable<System.Int32> |
typeIds |
|
View Source
Get(Guid)
Declaration
public TItem Get(Guid id)
Parameters
| Type |
Name |
Description |
| Guid |
id |
|
Returns
View Source
Get(Int32)
Declaration
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
View Source
Get(String)
Declaration
public TItem Get(string alias)
Parameters
| Type |
Name |
Description |
| System.String |
alias |
|
Returns
View Source
GetAll()
Declaration
public IEnumerable<TItem> GetAll()
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetAllAllowedAsRootAsync(Int32, Int32)
Returns all the content type allowed as root.
Declaration
public async Task<PagedModel<TItem>> GetAllAllowedAsRootAsync(int skip, int take)
Parameters
| Type |
Name |
Description |
| System.Int32 |
skip |
|
| System.Int32 |
take |
|
Returns
View Source
GetAllowedChildrenAsync(Guid, Int32, Int32)
Returns all content types allowed as children for a given content type key.
Declaration
public async Task<Attempt<PagedModel<TItem>, ContentTypeOperationStatus>> GetAllowedChildrenAsync(Guid key, int skip, int take)
Parameters
| Type |
Name |
Description |
| Guid |
key |
The content type key.
|
| System.Int32 |
skip |
|
| System.Int32 |
take |
|
Returns
View Source
GetAllowedChildrenAsync(Guid, Nullable<Guid>, Int32, Int32)
Returns all content types allowed as children for a given content type key.
Declaration
public async Task<Attempt<PagedModel<TItem>, ContentTypeOperationStatus>> GetAllowedChildrenAsync(Guid key, Guid? parentContentKey, int skip, int take)
Parameters
| Type |
Name |
Description |
| Guid |
key |
The content type key.
|
| System.Nullable<Guid> |
parentContentKey |
The parent content key.
|
| System.Int32 |
skip |
|
| System.Int32 |
take |
|
Returns
View Source
GetAsync(Guid)
Declaration
public Task<TItem> GetAsync(Guid guid)
Parameters
| Type |
Name |
Description |
| Guid |
guid |
The key of the content type.
|
Returns
| Type |
Description |
| Task<TItem> |
The found content type, null if none was found.
|
View Source
GetChildren(Guid)
Declaration
public IEnumerable<TItem> GetChildren(Guid id)
Parameters
| Type |
Name |
Description |
| Guid |
id |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetChildren(Int32)
Declaration
public IEnumerable<TItem> GetChildren(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetComposedOf(Int32)
Declaration
public IEnumerable<TItem> GetComposedOf(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetComposedOf(Int32, IEnumerable<TItem>)
Declaration
public IEnumerable<TItem> GetComposedOf(int id, IEnumerable<TItem> all)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
| IEnumerable<TItem> |
all |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetContainer(Guid)
Declaration
public EntityContainer GetContainer(Guid containerId)
Parameters
| Type |
Name |
Description |
| Guid |
containerId |
|
Returns
View Source
GetContainer(Int32)
Declaration
public EntityContainer GetContainer(int containerId)
Parameters
| Type |
Name |
Description |
| System.Int32 |
containerId |
|
Returns
View Source
GetContainers(TItem)
Declaration
public IEnumerable<EntityContainer> GetContainers(TItem item)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
Returns
View Source
GetContainers(Int32[])
Declaration
public IEnumerable<EntityContainer> GetContainers(int[] containerIds)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
containerIds |
|
Returns
View Source
GetContainers(String, Int32)
Declaration
public IEnumerable<EntityContainer> GetContainers(string name, int level)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.Int32 |
level |
|
Returns
View Source
GetContentTypeChangedNotification(IEnumerable<ContentTypeChange<TItem>>, EventMessages)
Declaration
protected abstract ContentTypeChangeNotification<TItem> GetContentTypeChangedNotification(IEnumerable<ContentTypeChange<TItem>> changes, EventMessages eventMessages)
Parameters
Returns
View Source
GetContentTypeRefreshedNotification(IEnumerable<ContentTypeChange<TItem>>, EventMessages)
Declaration
protected abstract ContentTypeRefreshNotification<TItem> GetContentTypeRefreshedNotification(IEnumerable<ContentTypeChange<TItem>> changes, EventMessages eventMessages)
Parameters
Returns
View Source
GetDeletedNotification(IEnumerable<TItem>, EventMessages)
Declaration
protected abstract DeletedNotification<TItem> GetDeletedNotification(IEnumerable<TItem> items, EventMessages eventMessages)
Parameters
| Type |
Name |
Description |
| IEnumerable<TItem> |
items |
|
| EventMessages |
eventMessages |
|
Returns
View Source
GetDeletingNotification(TItem, EventMessages)
Declaration
protected abstract DeletingNotification<TItem> GetDeletingNotification(TItem item, EventMessages eventMessages)
Parameters
Returns
View Source
GetDeletingNotification(IEnumerable<TItem>, EventMessages)
Declaration
protected abstract DeletingNotification<TItem> GetDeletingNotification(IEnumerable<TItem> items, EventMessages eventMessages)
Parameters
| Type |
Name |
Description |
| IEnumerable<TItem> |
items |
|
| EventMessages |
eventMessages |
|
Returns
View Source
GetDescendants(Int32, Boolean)
Declaration
public IEnumerable<TItem> GetDescendants(int id, bool andSelf)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
| System.Boolean |
andSelf |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetMany(Int32[])
Declaration
public IEnumerable<TItem> GetMany(params int[] ids)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
ids |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetMany(Nullable<IEnumerable<Guid>>)
Declaration
public IEnumerable<TItem> GetMany(IEnumerable<Guid>? ids)
Parameters
| Type |
Name |
Description |
| System.Nullable<IEnumerable<Guid>> |
ids |
|
Returns
| Type |
Description |
| IEnumerable<TItem> |
|
View Source
GetMovedNotification(IEnumerable<MoveEventInfo<TItem>>, EventMessages)
Declaration
protected abstract MovedNotification<TItem> GetMovedNotification(IEnumerable<MoveEventInfo<TItem>> moveInfo, EventMessages eventMessages)
Parameters
Returns
View Source
GetMovingNotification(MoveEventInfo<TItem>, EventMessages)
Declaration
protected abstract MovingNotification<TItem> GetMovingNotification(MoveEventInfo<TItem> moveInfo, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavedNotification(TItem, EventMessages)
Declaration
protected abstract SavedNotification<TItem> GetSavedNotification(TItem item, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavedNotification(IEnumerable<TItem>, EventMessages)
Declaration
protected abstract SavedNotification<TItem> GetSavedNotification(IEnumerable<TItem> items, EventMessages eventMessages)
Parameters
| Type |
Name |
Description |
| IEnumerable<TItem> |
items |
|
| EventMessages |
eventMessages |
|
Returns
View Source
GetSavingNotification(TItem, EventMessages)
Declaration
protected abstract SavingNotification<TItem> GetSavingNotification(TItem item, EventMessages eventMessages)
Parameters
Returns
View Source
GetSavingNotification(IEnumerable<TItem>, EventMessages)
Declaration
protected abstract SavingNotification<TItem> GetSavingNotification(IEnumerable<TItem> items, EventMessages eventMessages)
Parameters
| Type |
Name |
Description |
| IEnumerable<TItem> |
items |
|
| EventMessages |
eventMessages |
|
Returns
View Source
HasChildren(Guid)
Declaration
public bool HasChildren(Guid id)
Parameters
| Type |
Name |
Description |
| Guid |
id |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
HasChildren(Int32)
Declaration
public bool HasChildren(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
HasContainerInPath(Int32[])
Declaration
public bool HasContainerInPath(params int[] ids)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
ids |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
HasContainerInPath(String)
Given the path of a content item, this will return true if the content item exists underneath a list view content item
Declaration
public bool HasContainerInPath(string contentPath)
Parameters
| Type |
Name |
Description |
| System.String |
contentPath |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
HasContentNodes(Int32)
Declaration
public bool HasContentNodes(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
Move(TItem, Int32)
Declaration
public Attempt<OperationResult<MoveOperationStatusType>> Move(TItem moving, int containerId)
Parameters
| Type |
Name |
Description |
| TItem |
moving |
|
| System.Int32 |
containerId |
|
Returns
View Source
MoveAsync(Guid, Nullable<Guid>)
Declaration
public async Task<Attempt<TItem, ContentTypeStructureOperationStatus>> MoveAsync(Guid key, Guid? containerKey)
Parameters
| Type |
Name |
Description |
| Guid |
key |
|
| System.Nullable<Guid> |
containerKey |
|
Returns
View Source
RenameContainer(Int32, String, Int32)
Declaration
public Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = -1)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
| System.String |
name |
|
| System.Int32 |
userId |
|
Returns
View Source
Save(TItem, Int32)
Declaration
public void Save(TItem item, int userId = -1)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
| System.Int32 |
userId |
|
View Source
Save(IEnumerable<TItem>, Int32)
Declaration
public void Save(IEnumerable<TItem> items, int userId = -1)
Parameters
| Type |
Name |
Description |
| IEnumerable<TItem> |
items |
|
| System.Int32 |
userId |
|
View Source
SaveAsync(TItem, Guid)
Declaration
public async Task SaveAsync(TItem item, Guid performingUserKey)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
| Guid |
performingUserKey |
|
Returns
View Source
SaveContainer(EntityContainer, Int32)
Declaration
public Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = -1)
Parameters
Returns
View Source
UpdateAsync(TItem, Guid)
Declaration
public async Task<Attempt<ContentTypeOperationStatus>> UpdateAsync(TItem item, Guid performingUserKey)
Parameters
| Type |
Name |
Description |
| TItem |
item |
|
| Guid |
performingUserKey |
|
Returns
View Source
ValidateComposition(TItem)
Declaration
public Attempt<string[]> ValidateComposition(TItem compo)
Parameters
| Type |
Name |
Description |
| TItem |
compo |
|
Returns
| Type |
Description |
| Attempt<System.String[]> |
|
View Source
ValidateLocked(TItem)
Declaration
protected void ValidateLocked(TItem compositionContentType)
Parameters
| Type |
Name |
Description |
| TItem |
compositionContentType |
|
Explicit Interface Implementations
View Source
IContentTypeBaseService.Get(Int32)
Declaration
IContentTypeComposition IContentTypeBaseService.Get(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns