You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Api/PagingResource.cs

32 lines
985 B

using System.Collections.Generic;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Api
{
public class PagingResource<TResource>
{
public int Page { get; set; }
public int PageSize { get; set; }
public string SortKey { get; set; }
public SortDirection SortDirection { get; set; }
public string FilterKey { get; set; }
public string FilterValue { get; set; }
public int TotalRecords { get; set; }
public List<TResource> Records { get; set; }
}
public static class PagingResourceMapper
{
public static PagingSpec<TModel> MapToPagingSpec<TResource, TModel>(this PagingResource<TResource> pagingSpec)
{
return new PagingSpec<TModel>
{
Page = pagingSpec.Page,
PageSize = pagingSpec.PageSize,
SortKey = pagingSpec.SortKey,
SortDirection = pagingSpec.SortDirection,
};
}
}
}