Interface IEntityContainerRepository
Represents a repository for EntityContainer entities (folders).
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IEntityContainerRepository : IReadRepository<int, EntityContainer>, IWriteRepository<EntityContainer>, IRepository
Methods
View SourceGet(Guid)
Gets a container by its unique identifier.
Declaration
EntityContainer? Get(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The unique identifier of the container. |
Returns
| Type | Description |
|---|---|
| EntityContainer | The container if found; otherwise, |
Get(string, int)
Gets containers by name and level.
Declaration
IEnumerable<EntityContainer> Get(string name, int level)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the containers. |
| int | level | The level of the containers in the hierarchy. |
Returns
| Type | Description |
|---|---|
| IEnumerable<EntityContainer> | A collection of containers matching the criteria. |
HasDuplicateName(Guid, string)
Checks whether a container with the same name exists under the specified parent.
Declaration
bool HasDuplicateName(Guid parentKey, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | parentKey | The unique key of the parent container. |
| string | name | The name to check for duplicates. |
Returns
| Type | Description |
|---|---|
| bool |
|
HasDuplicateName(int, string)
Checks whether a container with the same name exists under the specified parent.
Declaration
bool HasDuplicateName(int parentId, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| int | parentId | The identifier of the parent container. |
| string | name | The name to check for duplicates. |
Returns
| Type | Description |
|---|---|
| bool |
|