V10: fix build warnings nucache (#12500)
* Run code cleanup * Finish dotnet format and manual cleanup * Fix according to review Co-authored-by: Zeegaan <nge@umbraco.dk>
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
using Umbraco.Cms.Core.PublishedCache;
|
||||
using Umbraco.Cms.Core.Routing;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
namespace Umbraco.Cms.Infrastructure.PublishedCache;
|
||||
|
||||
public static class DomainCacheExtensions
|
||||
{
|
||||
public static class DomainCacheExtensions
|
||||
public static bool GetAssignedWithCulture(this IDomainCache domainCache, string? culture, int documentId,
|
||||
bool includeWildcards = false)
|
||||
{
|
||||
public static bool GetAssignedWithCulture(this IDomainCache domainCache, string? culture, int documentId, bool includeWildcards = false)
|
||||
{
|
||||
var assigned = domainCache.GetAssigned(documentId, includeWildcards);
|
||||
IEnumerable<Domain> assigned = domainCache.GetAssigned(documentId, includeWildcards);
|
||||
|
||||
// It's super important that we always compare cultures with ignore case, since we can't be sure of the casing!
|
||||
// Comparing with string.IsNullOrEmpty since both empty string and null signifies invariant.
|
||||
return string.IsNullOrEmpty(culture) ? assigned.Any() : assigned.Any(x => x.Culture?.Equals(culture, StringComparison.InvariantCultureIgnoreCase) ?? false);
|
||||
}
|
||||
// It's super important that we always compare cultures with ignore case, since we can't be sure of the casing!
|
||||
// Comparing with string.IsNullOrEmpty since both empty string and null signifies invariant.
|
||||
return string.IsNullOrEmpty(culture)
|
||||
? assigned.Any()
|
||||
: assigned.Any(x => x.Culture?.Equals(culture, StringComparison.InvariantCultureIgnoreCase) ?? false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user