Implements GetByContentType in nucache

This commit is contained in:
Shannon
2019-02-14 00:17:33 +11:00
parent 412c9ffa6e
commit 3ffeb751b9
3 changed files with 7 additions and 4 deletions

View File

@@ -548,7 +548,9 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
public override IEnumerable<IPublishedContent> GetByContentType(PublishedContentType contentType)
{
throw new NotImplementedException();
return GetAtRoot()
.SelectMany(x => x.DescendantsOrSelf())
.Where(x => x.ContentType == contentType);
}
#endregion

View File

@@ -208,8 +208,7 @@ namespace Umbraco.Web.PublishedCache
/// <returns>The content type, or null.</returns>
/// <remarks>The alias is case-insensitive.</remarks>
PublishedContentType GetContentType(string alias);
// TODO: can we implement this, now? maybe only with NuCache else will throw NotImplemented...
IEnumerable<IPublishedContent> GetByContentType(PublishedContentType contentType);
}
}

View File

@@ -388,7 +388,9 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override IEnumerable<IPublishedContent> GetByContentType(PublishedContentType contentType)
{
throw new NotImplementedException();
return GetAtRoot()
.SelectMany(x => x.DescendantsOrSelf())
.Where(x => x.ContentType == contentType);
}
#endregion