mirror of
				https://github.com/Biarity/Sieve.git
				synced 2025-10-31 16:58:55 +01:00 
			
		
		
		
	* Update sample project to dotnetcore3.1 * Use Sqlite in sample project to run it everywhere * Fix: Filter with escaped comma * Fix: Filter "null" does not work with Contains or StartsWith * Code cleanup: Adjust namespaces, adjust usings
		
			
				
	
	
		
			16 lines
		
	
	
		
			495 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			495 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Linq;
 | |
| using Sieve.Sample.Entities;
 | |
| using Sieve.Services;
 | |
| 
 | |
| namespace Sieve.Sample.Services
 | |
| {
 | |
|     public class SieveCustomSortMethods : ISieveCustomSortMethods
 | |
|     {
 | |
|         public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy) => useThenBy
 | |
|             ? ((IOrderedQueryable<Post>)source).ThenBy(p => p.LikeCount)
 | |
|             : source.OrderBy(p => p.LikeCount)
 | |
|                 .ThenBy(p => p.CommentCount)
 | |
|                 .ThenBy(p => p.DateCreated);
 | |
|     }
 | |
| }
 |