You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Framework/Connected.Expressions/Translation/Rewriters/WhereClauseRewriter.cs

25 lines
637 B

using System.Linq.Expressions;
using Connected.Expressions.Visitors;
namespace Connected.Expressions.Translation.Rewriters;
public class WhereClauseRewriter : DatabaseVisitor
{
protected WhereClauseRewriter(ExpressionCompilationContext context)
{
Context = context;
}
public ExpressionCompilationContext Context { get; }
public static Expression Rewrite(ExpressionCompilationContext context, Expression expression)
{
return new WhereClauseRewriter(context).Visit(expression);
}
protected override Expression VisitWhere(Expression whereExpression)
{
return ParameterRewriter.Rewrite(Context, whereExpression);
}
}