diff --git a/sample/AutoQueryDemo/Program.cs b/sample/AutoQueryDemo/Program.cs index f2391be..6191daf 100644 --- a/sample/AutoQueryDemo/Program.cs +++ b/sample/AutoQueryDemo/Program.cs @@ -18,6 +18,7 @@ Fields = "Id,Name", Sort = "-Id", FilterIds = [3, 4], + FilterName = "Alice Johnson" }).ToArray(); Console.WriteLine("Filtered Users:"); diff --git a/src/AutoQuery/Internal/MultiParameterReplacer.cs b/src/AutoQuery/Internal/MultiParameterReplacer.cs index ec3a71c..74a01f8 100644 --- a/src/AutoQuery/Internal/MultiParameterReplacer.cs +++ b/src/AutoQuery/Internal/MultiParameterReplacer.cs @@ -3,7 +3,7 @@ namespace AutoQuery.Internal; /// -/// MultiParameterReplacer 類別用於替換表達式中的多個參數。 +/// The MultiParameterReplacer class is used to replace multiple parameters in an expression. /// internal class MultiParameterReplacer : ExpressionVisitor { @@ -13,12 +13,12 @@ internal class MultiParameterReplacer : ExpressionVisitor private readonly Expression _replacement2; /// - /// 初始化 MultiParameterReplacer 類別的新實例。 + /// Initializes a new instance of the MultiParameterReplacer class. /// - /// 要替換的第一個參數。 - /// 第一個參數的替換表達式。 - /// 要替換的第二個參數。 - /// 第二個參數的替換表達式。 + /// The first parameter to replace. + /// The replacement expression for the first parameter. + /// The second parameter to replace. + /// The replacement expression for the second parameter. internal MultiParameterReplacer(ParameterExpression param1, Expression replacement1, ParameterExpression param2, Expression replacement2) { _param1 = param1; @@ -28,10 +28,10 @@ internal MultiParameterReplacer(ParameterExpression param1, Expression replaceme } /// - /// 訪問參數節點並進行替換。 + /// Visits a parameter node and performs replacement. /// - /// 要訪問的參數節點。 - /// 替換後的表達式。 + /// The parameter node to visit. + /// The expression after replacement. protected override Expression VisitParameter(ParameterExpression node) { if (node == _param1) return _replacement1; diff --git a/src/AutoQuery/Internal/ParameterReplacer.cs b/src/AutoQuery/Internal/ParameterReplacer.cs index ee9d894..479c940 100644 --- a/src/AutoQuery/Internal/ParameterReplacer.cs +++ b/src/AutoQuery/Internal/ParameterReplacer.cs @@ -3,7 +3,7 @@ namespace AutoQuery.Internal; /// -/// 參數替換器,用於在表達式樹中替換參數。 +/// A parameter replacer used to replace parameters in an expression tree. /// internal class ParameterReplacer : ExpressionVisitor { @@ -11,10 +11,10 @@ internal class ParameterReplacer : ExpressionVisitor private readonly Expression _newParam; /// - /// 初始化 類別的新執行個體。 + /// Initializes a new instance of the class. /// - /// 要被替換的舊參數。 - /// 用來替換的新的表達式。 + /// The old parameter to be replaced. + /// The new expression to replace with. internal ParameterReplacer(ParameterExpression oldParam, Expression newParam) { _oldParam = oldParam; @@ -22,10 +22,10 @@ internal ParameterReplacer(ParameterExpression oldParam, Expression newParam) } /// - /// 訪問並可能修改參數表達式。 + /// Visits and potentially modifies a parameter expression. /// - /// 要訪問的參數表達式。 - /// 替換後的表達式,如果沒有替換則返回原始表達式。 + /// The parameter expression to visit. + /// The replaced expression, or the original expression if no replacement occurred. protected override Expression VisitParameter(ParameterExpression node) { return node == _oldParam ? _newParam : base.VisitParameter(node);