Questions tagged [iorderedqueryable]

8 questions
18
votes
2 answers

Cannot convert IQueryable<> to IOrderedQueryable error

I have the following LINQ code: var posts = (from p in db.Posts .Include("Site") .Include("PostStatus") where p.Public == false orderby p.PublicationTime select p); if (!chkShowIgnored.Checked)…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
10
votes
3 answers

Dynamic Func, IOrderedQueryable> Expression

I am using patterns mentioned here http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application And i am using method below to query EF public virtual…
bahadir arslan
  • 4,535
  • 7
  • 44
  • 82
2
votes
0 answers

Better way to get index of ordered queryable list at entity framework?

Are there any way to get index of ordered queryable without getting all items? My code seems to be killer of network traffic: public virtual async Task GetIndexOfQueryable(Expression> whereExp, Predicate
1
vote
0 answers

Add IOrderedQueryable to IQueryable

I have this generic method that I'm trying to make, and in order to achieve that I want to pass an IOrderedQueryable as a parameter. public async Task> GetListAsync(Expression> filter, IOrderedQueryable…
1
vote
1 answer

how can i pass parameter for Func, IOrderedQueryable> orderBy = null,

I have the following generic repository function but am unable to pass a parameter for order by Task> AdvGetAllAsync( Expression> expression = null, Func, IOrderedQueryable> orderBy =…
1
vote
1 answer

Dynamic OrderBy // InvalidOperationException: No generic method 'ThenByDescending' on type 'System.Linq.Queryable' is compatible

I'm trying to build a dynamic OrderBy method that I can call repeatedly, unfortunately I keep getting the same error despite implementing code that has been reported to fix it. I've dissected my code several times whilst referring to two SO posts…
Matthew Hudson
  • 1,306
  • 15
  • 36
1
vote
1 answer

Set Collation on IOrderedQueryable list

I use following code for sorting list in application and it is working fine. public static class OrderByHelper { public static IOrderedQueryable OrderBy(this IQueryable source, string property) { return…
A.T.
  • 24,694
  • 8
  • 47
  • 65
1
vote
1 answer

When using LINQ to create a collection of IOrderedQueryable are you overriding the GetEnumerator method?

I understand that if you construct a LINQ query and append it with .ToList() you are executing that LINQ query there and then and returning a list object. However, if you don't do this, you instead get an IOrderedQueryable object which as I…
BenM
  • 4,218
  • 2
  • 31
  • 58