changed to .net standard.

This commit is contained in:
David Lebée
2018-02-20 21:21:23 -06:00
parent f6ce5a45af
commit 8396e24305
11 changed files with 53 additions and 214 deletions
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
@@ -96,13 +95,13 @@ namespace PoweredSoft.DynamicLinq.Helpers
throw new NotSupportedException($"{convertStrategy} supplied is not recognized");
}
public static IQueryable<T> CreateSortExpression<T>(IQueryable<T> query, string sortPath, SortOrder sortOrder, bool appendSort = true)
public static IQueryable<T> CreateSortExpression<T>(IQueryable<T> query, string sortPath, QuerySortDirection sortDirection, bool appendSort = true)
{
var parameter = Expression.Parameter(typeof(T), "t");
var member = QueryableHelpers.ResolvePathForExpression(parameter, sortPath);
string sortCommand = null;
if (sortOrder == SortOrder.Descending)
if (sortDirection == QuerySortDirection.Descending)
sortCommand = appendSort == false ? "OrderByDescending" : "ThenByDescending";
else
sortCommand = appendSort == false ? "OrderBy" : "ThenBy";