From 0d600d6677d23291ecf1c97c8ecb1403cde006d7 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle Date: Wed, 20 Apr 2022 08:42:06 +0200 Subject: [PATCH] Dont return nullable lists --- .../Persistence/Repositories/IDomainRepository.cs | 4 ++-- src/Umbraco.Core/Services/DomainService.cs | 4 ++-- .../Repositories/Implement/DomainRepository.cs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/IDomainRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IDomainRepository.cs index 007c2928a4..a24b76f90a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/IDomainRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/IDomainRepository.cs @@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Persistence.Repositories { IDomain? GetByName(string domainName); bool Exists(string domainName); - IEnumerable? GetAll(bool includeWildcards); - IEnumerable? GetAssignedDomains(int contentId, bool includeWildcards); + IEnumerable GetAll(bool includeWildcards); + IEnumerable GetAssignedDomains(int contentId, bool includeWildcards); } } diff --git a/src/Umbraco.Core/Services/DomainService.cs b/src/Umbraco.Core/Services/DomainService.cs index 3d1c12d6b7..2829368fa2 100644 --- a/src/Umbraco.Core/Services/DomainService.cs +++ b/src/Umbraco.Core/Services/DomainService.cs @@ -65,7 +65,7 @@ namespace Umbraco.Cms.Core.Services } } - public IEnumerable? GetAll(bool includeWildcards) + public IEnumerable GetAll(bool includeWildcards) { using (var scope = ScopeProvider.CreateScope(autoComplete: true)) { @@ -73,7 +73,7 @@ namespace Umbraco.Cms.Core.Services } } - public IEnumerable? GetAssignedDomains(int contentId, bool includeWildcards) + public IEnumerable GetAssignedDomains(int contentId, bool includeWildcards) { using (var scope = ScopeProvider.CreateScope(autoComplete: true)) { diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DomainRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DomainRepository.cs index 793a88c262..0cc0bc44ad 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DomainRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DomainRepository.cs @@ -162,14 +162,14 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement return GetMany()?.Any(x => x.DomainName.InvariantEquals(domainName)) ?? false; } - public IEnumerable? GetAll(bool includeWildcards) + public IEnumerable GetAll(bool includeWildcards) { - return GetMany()?.Where(x => includeWildcards || x.IsWildcard == false); + return GetMany().Where(x => includeWildcards || x.IsWildcard == false); } - public IEnumerable? GetAssignedDomains(int contentId, bool includeWildcards) + public IEnumerable GetAssignedDomains(int contentId, bool includeWildcards) { - return GetMany()? + return GetMany() .Where(x => x.RootContentId == contentId) .Where(x => includeWildcards || x.IsWildcard == false); }