U4-8447 - prepare for NuCache (work-in-progress)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
{
|
||||
class DomainCache : IDomainCache
|
||||
{
|
||||
private readonly IDomainService _domainService;
|
||||
|
||||
public DomainCache(IDomainService domainService)
|
||||
{
|
||||
_domainService = domainService;
|
||||
}
|
||||
|
||||
public IEnumerable<Domain> GetAll(bool includeWildcards)
|
||||
{
|
||||
return _domainService.GetAll(includeWildcards)
|
||||
.Where(x => x.RootContentId.HasValue && x.LanguageIsoCode.IsNullOrWhiteSpace() == false)
|
||||
.Select(x => new Domain(x.Id, x.DomainName, x.RootContentId.Value, CultureInfo.GetCultureInfo(x.LanguageIsoCode), x.IsWildcard));
|
||||
}
|
||||
|
||||
public IEnumerable<Domain> GetAssigned(int contentId, bool includeWildcards)
|
||||
{
|
||||
return _domainService.GetAssignedDomains(contentId, includeWildcards)
|
||||
.Where(x => x.RootContentId.HasValue && x.LanguageIsoCode.IsNullOrWhiteSpace() == false)
|
||||
.Select(x => new Domain(x.Id, x.DomainName, x.RootContentId.Value, CultureInfo.GetCultureInfo(x.LanguageIsoCode), x.IsWildcard));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user