Share via


ExpressionVisitor.VisitAndConvert 方法

定義

造訪運算式,並將結果轉換回原始運算式型別。

多載

VisitAndConvert<T>(ReadOnlyCollection<T>, String)

瀏覽集合中的運算式,並將結果轉換回原始運算式類型。

VisitAndConvert<T>(T, String)

造訪運算式,並將結果轉換回原始運算式型別。

VisitAndConvert<T>(ReadOnlyCollection<T>, String)

來源:
ExpressionVisitor.cs
來源:
ExpressionVisitor.cs
來源:
ExpressionVisitor.cs

瀏覽集合中的運算式,並將結果轉換回原始運算式類型。

public:
generic <typename T>
 where T : System::Linq::Expressions::Expression System::Collections::ObjectModel::ReadOnlyCollection<T> ^ VisitAndConvert(System::Collections::ObjectModel::ReadOnlyCollection<T> ^ nodes, System::String ^ callerName);
public System.Collections.ObjectModel.ReadOnlyCollection<T> VisitAndConvert<T> (System.Collections.ObjectModel.ReadOnlyCollection<T> nodes, string callerName) where T : System.Linq.Expressions.Expression;
public System.Collections.ObjectModel.ReadOnlyCollection<T> VisitAndConvert<T> (System.Collections.ObjectModel.ReadOnlyCollection<T> nodes, string? callerName) where T : System.Linq.Expressions.Expression;
member this.VisitAndConvert : System.Collections.ObjectModel.ReadOnlyCollection<'T (requires 'T :> System.Linq.Expressions.Expression)> * string -> System.Collections.ObjectModel.ReadOnlyCollection<'T (requires 'T :> System.Linq.Expressions.Expression)> (requires 'T :> System.Linq.Expressions.Expression)
Public Function VisitAndConvert(Of T As Expression) (nodes As ReadOnlyCollection(Of T), callerName As String) As ReadOnlyCollection(Of T)

類型參數

T

表達式的類型。

參數

nodes
ReadOnlyCollection<T>

要造訪的運算式。

callerName
String

呼叫方法的名稱,用於回報更佳的錯誤訊息。

傳回

如果任一運算式已經修正,則會傳回修正的運算式集合,否則傳回原始運算式集合。

例外狀況

其中一個運算式的瀏覽方法傳回不同的型別。

適用於

VisitAndConvert<T>(T, String)

來源:
ExpressionVisitor.cs
來源:
ExpressionVisitor.cs
來源:
ExpressionVisitor.cs

造訪運算式,並將結果轉換回原始運算式型別。

public:
generic <typename T>
 where T : System::Linq::Expressions::Expression T VisitAndConvert(T node, System::String ^ callerName);
public T VisitAndConvert<T> (T node, string callerName) where T : System.Linq.Expressions.Expression;
public T? VisitAndConvert<T> (T? node, string? callerName) where T : System.Linq.Expressions.Expression;
member this.VisitAndConvert : 'T * string -> 'T (requires 'T :> System.Linq.Expressions.Expression)
Public Function VisitAndConvert(Of T As Expression) (node As T, callerName As String) As T

類型參數

T

運算式的型別。

參數

node
T

要造訪的運算式。

callerName
String

呼叫方法的名稱,用來回報較佳的錯誤訊息。

傳回

T

如果運算式本身或是任一子運算式已經修正,會傳回修正的運算式,否則傳回原始運算式。

例外狀況

這個節點的造訪方法傳回不同的型別。

適用於