Added some tests for PagingSpecExtensions

Allow specials in missing
Dropped ListSortDirection
This commit is contained in:
Mark McDowall 2013-05-07 00:22:19 -07:00
commit f4dd6adc6a
12 changed files with 131 additions and 92 deletions

View file

@ -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);