Dont return nullable lists
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Persistence.Repositories
|
||||
{
|
||||
IDomain? GetByName(string domainName);
|
||||
bool Exists(string domainName);
|
||||
IEnumerable<IDomain>? GetAll(bool includeWildcards);
|
||||
IEnumerable<IDomain>? GetAssignedDomains(int contentId, bool includeWildcards);
|
||||
IEnumerable<IDomain> GetAll(bool includeWildcards);
|
||||
IEnumerable<IDomain> GetAssignedDomains(int contentId, bool includeWildcards);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Umbraco.Cms.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IDomain>? GetAll(bool includeWildcards)
|
||||
public IEnumerable<IDomain> GetAll(bool includeWildcards)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace Umbraco.Cms.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IDomain>? GetAssignedDomains(int contentId, bool includeWildcards)
|
||||
public IEnumerable<IDomain> GetAssignedDomains(int contentId, bool includeWildcards)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
|
||||
@@ -162,14 +162,14 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
|
||||
return GetMany()?.Any(x => x.DomainName.InvariantEquals(domainName)) ?? false;
|
||||
}
|
||||
|
||||
public IEnumerable<IDomain>? GetAll(bool includeWildcards)
|
||||
public IEnumerable<IDomain> GetAll(bool includeWildcards)
|
||||
{
|
||||
return GetMany()?.Where(x => includeWildcards || x.IsWildcard == false);
|
||||
return GetMany().Where(x => includeWildcards || x.IsWildcard == false);
|
||||
}
|
||||
|
||||
public IEnumerable<IDomain>? GetAssignedDomains(int contentId, bool includeWildcards)
|
||||
public IEnumerable<IDomain> GetAssignedDomains(int contentId, bool includeWildcards)
|
||||
{
|
||||
return GetMany()?
|
||||
return GetMany()
|
||||
.Where(x => x.RootContentId == contentId)
|
||||
.Where(x => includeWildcards || x.IsWildcard == false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user