Introduced methods on the IEntityTypeContainerService, so have alternatives for obsoleted methods. E.g. IDataTypeService.GetContainers(string folderName, int level) and a GetAllAsync (#17208)
This commit is contained in:
@@ -50,6 +50,22 @@ internal abstract class EntityTypeContainerService<TTreeEntity, TEntityContainer
|
||||
return await Task.FromResult(_entityContainerRepository.Get(id));
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IEnumerable<EntityContainer>> GetAsync(string name, int level)
|
||||
{
|
||||
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
|
||||
ReadLock(scope);
|
||||
return await Task.FromResult(_entityContainerRepository.Get(name, level));
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public async Task<IEnumerable<EntityContainer>> GetAllAsync()
|
||||
{
|
||||
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
|
||||
ReadLock(scope);
|
||||
return await Task.FromResult(_entityContainerRepository.GetMany());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<EntityContainer?> GetParentAsync(EntityContainer container)
|
||||
=> await Task.FromResult(GetParent(container));
|
||||
|
||||
@@ -14,6 +14,20 @@ public interface IEntityTypeContainerService<TTreeEntity>
|
||||
/// <returns></returns>
|
||||
Task<EntityContainer?> GetAsync(Guid id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets containers by name and level
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the containers to get.</param>
|
||||
/// <param name="level">The level in the tree of the containers to get.</param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<EntityContainer>> GetAsync(string name, int level);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all containers
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<EntityContainer>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parent container of a container
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user