diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DictionaryRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DictionaryRepository.cs index a93ae543a0..99d32f373d 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DictionaryRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DictionaryRepository.cs @@ -223,6 +223,19 @@ internal class DictionaryRepository : EntityRepositoryBase return new SingleItemsOnlyRepositoryCachePolicy(GlobalIsolatedCache, ScopeAccessor, options); } + + protected override IEnumerable PerformGetAll(params Guid[]? ids) + { + Sql sql = GetBaseQuery(false).Where(x => x.PrimaryKey > 0); + if (ids?.Any() ?? false) + { + sql.WhereIn(x => x.UniqueId, ids); + } + + return Database + .FetchOneToMany(x => x.LanguageTextDtos, sql) + .Select(ConvertToEntity); + } } private class DictionaryByKeyRepository : SimpleGetRepository @@ -266,6 +279,19 @@ internal class DictionaryRepository : EntityRepositoryBase return new SingleItemsOnlyRepositoryCachePolicy(GlobalIsolatedCache, ScopeAccessor, options); } + + protected override IEnumerable PerformGetAll(params string[]? ids) + { + Sql sql = GetBaseQuery(false).Where(x => x.PrimaryKey > 0); + if (ids?.Any() ?? false) + { + sql.WhereIn(x => x.Key, ids); + } + + return Database + .FetchOneToMany(x => x.LanguageTextDtos, sql) + .Select(ConvertToEntity); + } } protected override IEnumerable PerformGetAll(params int[]? ids)