mirror of
				https://github.com/Biarity/Sieve.git
				synced 2025-11-04 02:39:00 +01:00 
			
		
		
		
	pass filter values as parameters (#112)
make GetClosureOverConstant really work
This commit is contained in:
		@@ -337,12 +337,10 @@ namespace Sieve.Services
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Workaround to ensure that the filter value gets passed as a parameter in generated SQL from EF Core
 | 
			
		||||
        // See https://github.com/aspnet/EntityFrameworkCore/issues/3361
 | 
			
		||||
        // Expression.Constant passed the target type to allow Nullable comparison
 | 
			
		||||
        // See http://bradwilson.typepad.com/blog/2008/07/creating-nullab.html
 | 
			
		||||
        private static Expression GetClosureOverConstant<T>(T constant, Type targetType)
 | 
			
		||||
        {
 | 
			
		||||
            return Expression.Constant(constant, targetType);
 | 
			
		||||
            Expression<Func<T>> hoistedConstant = () => constant;
 | 
			
		||||
            return Expression.Convert(hoistedConstant.Body, targetType);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private IQueryable<TEntity> ApplySorting<TEntity>(TSieveModel model, IQueryable<TEntity> result,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user