mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
Added some tests for PagingSpecExtensions
Allow specials in missing Dropped ListSortDirection
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -12,7 +11,13 @@ namespace NzbDrone.Core.Datastore
|
||||
public int PageSize { get; set; }
|
||||
public int TotalRecords { get; set; }
|
||||
public string SortKey { get; set; }
|
||||
public ListSortDirection SortDirection { get; set; }
|
||||
public List<TModel> Records { get; set; }
|
||||
public SortDirection SortDirection { get; set; }
|
||||
public List<TModel> Records { get; set; }
|
||||
}
|
||||
|
||||
public enum SortDirection
|
||||
{
|
||||
Ascending,
|
||||
Descending
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,13 @@ namespace NzbDrone.Core.Datastore
|
||||
return (pagingSpec.Page - 1)*pagingSpec.PageSize;
|
||||
}
|
||||
|
||||
public static Marr.Data.QGen.SortDirection ToSortDirection<TModel>(this PagingSpec<TModel> pagingSpec)
|
||||
{
|
||||
if (pagingSpec.SortDirection == SortDirection.Descending) return Marr.Data.QGen.SortDirection.Desc;
|
||||
|
||||
return Marr.Data.QGen.SortDirection.Asc;
|
||||
}
|
||||
|
||||
private static Expression<Func<TModel, object>> CreateExpression<TModel>(string propertyName)
|
||||
{
|
||||
Type type = typeof(TModel);
|
||||
|
||||
Reference in New Issue
Block a user