Gets indexes updating based on content type changes
This commit is contained in:
@@ -405,28 +405,20 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of <see cref="IContent"/> objects by the Id of the <see cref="IContentType"/>
|
||||
/// </summary>
|
||||
/// <param name="id">Id of the <see cref="IContentType"/></param>
|
||||
/// <returns>An Enumerable list of <see cref="IContent"/> objects</returns>
|
||||
public IEnumerable<IContent> GetByType(int id)
|
||||
public IEnumerable<IContent> GetPagedOfType(int contentTypeId, long pageIndex, int pageSize, out long totalRecords, IQuery<IContent> filter, Ordering ordering = null)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
var query = Query<IContent>().Where(x => x.ContentTypeId == id);
|
||||
return _documentRepository.Get(query);
|
||||
}
|
||||
}
|
||||
if(pageIndex < 0) throw new ArgumentOutOfRangeException(nameof(pageIndex));
|
||||
if (pageSize <= 0) throw new ArgumentOutOfRangeException(nameof(pageSize));
|
||||
|
||||
if (ordering == null)
|
||||
ordering = Ordering.By("sortOrder");
|
||||
|
||||
internal IEnumerable<IContent> GetPublishedContentOfContentType(int id)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
var query = Query<IContent>().Where(x => x.ContentTypeId == id);
|
||||
return _documentRepository.Get(query);
|
||||
return _documentRepository.GetPage(
|
||||
Query<IContent>().Where(x => x.ContentTypeId == contentTypeId),
|
||||
pageIndex, pageSize, out totalRecords, filter, ordering);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user