If the request doen't have an ordering, the entity framework returns an error to do the paging, so it could be better to set the default ordering to the Primary key of the entity if it doesn't have any order.
just like this, but getting the correct field using reflection
if (request.Sort == null || request.Sort.Count() == 0)
{
var sort = new List<Sort>();
sort.Add(new Sort() { Dir = "asc", Field = "Id" });
request.Sort = sort;
}
If the request doen't have an ordering, the entity framework returns an error to do the paging, so it could be better to set the default ordering to the Primary key of the entity if it doesn't have any order.
just like this, but getting the correct field using reflection