Find and remove parameter declaration inside Expression.Block
问题 I know how to replace a parameter with ExpressionVisitor but I was wondering if there's a way to remove a parameter from a Expression.Block. Ideally I should crawl the entire Expression tree and remove the parameter every time it is declared inside a Block. Any idea how to do that with ExpressionVisitor? 回答1: A simple class to remove local variables from a BlockExpression and replace them with whatever you want. public class BlockVariableRemover : ExpressionVisitor { private readonly