Merge pull request #4558 from umbraco/temp8-implement-GetByContentType-nucache

v8 - the GetByContentType methods for the content cache were not implemented
This commit is contained in:
Bjarke Berg
2019-02-14 08:36:24 +01:00
committed by GitHub
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