mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-23 22:12:48 +01:00
parent
e83d213181
commit
1a9371a636
@ -75,7 +75,7 @@ Where `SieveCustomSortMethodsOfPosts` for example is:
|
||||
```C#
|
||||
public class SieveCustomSortMethods : ISieveCustomSortMethods
|
||||
{
|
||||
public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc) // The method is given an indicator of weather to use ThenBy(), and if the query is descending
|
||||
public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc) // The method is given an indicator of whether to use ThenBy(), and if the query is descending
|
||||
{
|
||||
var result = useThenBy ?
|
||||
((IOrderedQueryable<Post>)source).ThenBy(p => p.LikeCount) : // ThenBy only works on IOrderedQueryable<TEntity>
|
||||
|
Loading…
Reference in New Issue
Block a user