Print Page | Close Window

SortSelector and EntityQueryPager

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3811
Printed Date: 25-Oct-2025 at 11:00pm


Topic: SortSelector and EntityQueryPager
Posted By: mseeli
Subject: SortSelector and EntityQueryPager
Date Posted: 19-Nov-2012 at 1:11am
I have been using EntityQueryPagedCollectionView in DevForce 2010 and am now changing it over to EntityQueryPager in DevForce 2012.

I have a rather complex sort expression (One that relyes on a ServerSide Function)
The current code looks like this

enq = enq.OrderBy(x => MySqlLinqFunctions.CacheField(x.Cache, SortFieldIdx));

where enq is the query that selects the records from the databse and here I add the OrderBy clause to it.
MySquLinqFunction is a server side function.

In DevForce 2012 I have to use a SortSelector for my EntityQueryPager

Can you please give me a hint how to do this?

I probably should use the constructor

http://drc.ideablade.com/ApiDocumentation2012/IdeaBlade.Linq~IdeaBlade.Linq.SortSelector~_ctor%28String,IPredicateDescription,ListSortDirection%29.html - SortSelector Constructor(String,IPredicateDescription,ListSortDirection)  

But I have no Idea what is meant with string MethodName (1st parameter)
Would I pass x => MySqlLinqFunctions.CacheField(x.Cache, SortFieldIdx) as the second parameter?

Thank you 
Markus Seeli



Replies:
Posted By: cefernan
Date Posted: 19-Nov-2012 at 6:33am
I need to create a sort expression with more than one property and different directions, maybe somebody can help me too.

Thanks.


Posted By: cefernan
Date Posted: 20-Nov-2012 at 12:16pm
I have used ThenBy in the SortSelector and I have solved my problem (more than 1 property).

Thanks and sorry to post in the same topic :)


Posted By: sbelini
Date Posted: 27-Nov-2012 at 12:32pm
Hi mseeli,

Unfortunatelly, the ctor below

SortSelector Constructor(String,IPredicateDescription,ListSortDirection)

will not be of help as you won't be able to invoke a server side function using the EntityQueryPager.

sbelini.




Print Page | Close Window