Changes recycle bin service queries to paged
This commit is contained in:
@@ -141,11 +141,11 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
IEnumerable<IContent> GetContentForRelease();
|
||||
|
||||
//fixme: should be paged
|
||||
/// <summary>
|
||||
/// Gets documents in the recycle bin.
|
||||
/// </summary>
|
||||
IEnumerable<IContent> GetContentInRecycleBin();
|
||||
IEnumerable<IContent> GetPagedContentInRecycleBin(long pageIndex, int pageSize, out long totalRecords,
|
||||
IQuery<IContent> filter = null, Ordering ordering = null);
|
||||
|
||||
/// <summary>
|
||||
/// Gets child documents of a parent.
|
||||
|
||||
@@ -170,7 +170,8 @@ namespace Umbraco.Core.Services
|
||||
/// Gets a collection of an <see cref="IMedia"/> objects, which resides in the Recycle Bin
|
||||
/// </summary>
|
||||
/// <returns>An Enumerable list of <see cref="IMedia"/> objects</returns>
|
||||
IEnumerable<IMedia> GetMediaInRecycleBin();
|
||||
IEnumerable<IMedia> GetPagedMediaInRecycleBin(long pageIndex, int pageSize, out long totalRecords,
|
||||
IQuery<IMedia> filter = null, Ordering ordering = null);
|
||||
|
||||
/// <summary>
|
||||
/// Moves an <see cref="IMedia"/> object to a new location
|
||||
|
||||
@@ -727,13 +727,17 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// Gets a collection of an <see cref="IContent"/> objects, which resides in the Recycle Bin
|
||||
/// </summary>
|
||||
/// <returns>An Enumerable list of <see cref="IContent"/> objects</returns>
|
||||
public IEnumerable<IContent> GetContentInRecycleBin()
|
||||
public IEnumerable<IContent> GetPagedContentInRecycleBin(long pageIndex, int pageSize, out long totalRecords,
|
||||
IQuery<IContent> filter = null, Ordering ordering = null)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
if (ordering == null)
|
||||
ordering = Ordering.By("Path");
|
||||
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
var query = Query<IContent>().Where(x => x.Path.StartsWith(Constants.System.RecycleBinContentPathPrefix));
|
||||
return _documentRepository.Get(query);
|
||||
return _documentRepository.GetPage(query, pageIndex, pageSize, out totalRecords, filter, ordering);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -643,17 +643,18 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of an <see cref="IMedia"/> objects, which resides in the Recycle Bin
|
||||
/// </summary>
|
||||
/// <returns>An Enumerable list of <see cref="IMedia"/> objects</returns>
|
||||
public IEnumerable<IMedia> GetMediaInRecycleBin()
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<IMedia> GetPagedMediaInRecycleBin(long pageIndex, int pageSize, out long totalRecords,
|
||||
IQuery<IMedia> filter = null, Ordering ordering = null)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
if (ordering == null)
|
||||
ordering = Ordering.By("Path");
|
||||
|
||||
scope.ReadLock(Constants.Locks.MediaTree);
|
||||
var query = Query<IMedia>().Where(x => x.Path.StartsWith(Constants.System.RecycleBinMediaPathPrefix));
|
||||
return _mediaRepository.Get(query);
|
||||
return _mediaRepository.GetPage(query, pageIndex, pageSize, out totalRecords, filter, ordering);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user