V14: Update DataTypeControllerBase to use GetAllAsync() (#15641)

* Update to use GetAllAsync()

* Obsolete GetAll

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
This commit is contained in:
Nikolaj Geisle
2024-01-31 15:00:47 +01:00
committed by GitHub
parent 008083f096
commit 0dd2beb484
2 changed files with 2 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ public class DataTypeTreeControllerBase : FolderTreeControllerBase<DataTypeTreeI
protected override DataTypeTreeItemResponseModel[] MapTreeItemViewModels(Guid? parentId, IEntitySlim[] entities)
{
var dataTypes = _dataTypeService
.GetAll(entities.Select(entity => entity.Id).ToArray())
.GetAllAsync(entities.Select(entity => entity.Key).ToArray()).GetAwaiter().GetResult()
.ToDictionary(contentType => contentType.Id);
return entities.Select(entity =>

View File

@@ -112,6 +112,7 @@ public interface IDataTypeService : IService
/// </summary>
/// <param name="ids">Optional array of Ids</param>
/// <returns>An enumerable list of <see cref="IDataType" /> objects</returns>
[Obsolete("Please use GetAllAsync. Will be removed in V15.")]
IEnumerable<IDataType> GetAll(params int[] ids);
/// <summary>