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.
25 lines
683 B
25 lines
683 B
using Connected.Expressions.Visitors;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace Connected.Expressions.Translation.Rewriters;
|
|
|
|
public class WhereClauseRewriter : DatabaseVisitor
|
|
{
|
|
private 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);
|
|
}
|
|
}
|