Interface IEntityTypeContainerService<TTreeEntity>
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IEntityTypeContainerService<TTreeEntity>
    where TTreeEntity : ITreeEntityType Parameters
| Name | Description | 
|---|---|
| TTreeEntity | 
Methods
View SourceCreateAsync(Nullable<Guid>, String, Nullable<Guid>, Guid)
Creates a new container
Declaration
Task<Attempt<EntityContainer, EntityContainerOperationStatus>> CreateAsync(Guid? key, string name, Guid? parentKey, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Nullable<Guid> | key | The key to assign to the newly created container (if null is specified, a random key will be assigned). | 
| System.String | name | The name of the created container. | 
| System.Nullable<Guid> | parentKey | The ID of the parent container to create the new container under. | 
| Guid | userKey | Key of the user issuing the creation. | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<EntityContainer, EntityContainerOperationStatus>> | 
Remarks
If parent key is supplied as null, the container will be created at the tree root.
DeleteAsync(Guid, Guid)
Deletes a container
Declaration
Task<Attempt<EntityContainer, EntityContainerOperationStatus>> DeleteAsync(Guid id, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | id | The ID of the container to delete. | 
| Guid | userKey | Key of the user issuing the deletion. | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<EntityContainer, EntityContainerOperationStatus>> | 
GetAsync(Guid)
Gets a container
Declaration
Task<EntityContainer> GetAsync(Guid id)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | id | The ID of the container to get. | 
Returns
| Type | Description | 
|---|---|
| Task<EntityContainer> | 
GetParentAsync(TTreeEntity)
Gets the parent container of an entity
Declaration
Task<EntityContainer> GetParentAsync(TTreeEntity entity)Parameters
| Type | Name | Description | 
|---|---|---|
| TTreeEntity | entity | The entity whose parent container to get. | 
Returns
| Type | Description | 
|---|---|
| Task<EntityContainer> | 
GetParentAsync(EntityContainer)
Gets the parent container of a container
Declaration
Task<EntityContainer> GetParentAsync(EntityContainer container)Parameters
| Type | Name | Description | 
|---|---|---|
| EntityContainer | container | The container whose parent container to get. | 
Returns
| Type | Description | 
|---|---|
| Task<EntityContainer> | 
UpdateAsync(Guid, String, Guid)
Updates an existing container
Declaration
Task<Attempt<EntityContainer, EntityContainerOperationStatus>> UpdateAsync(Guid key, string name, Guid userKey)Parameters
| Type | Name | Description | 
|---|---|---|
| Guid | key | The key of the container to update. | 
| System.String | name | The name to assign to the container. | 
| Guid | userKey | Key of the user issuing the update. | 
Returns
| Type | Description | 
|---|---|
| Task<Attempt<EntityContainer, EntityContainerOperationStatus>> |