ExpressionVisitor.VisitAndConvert 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
造訪一個表達式,將結果拋回原始表達式類型。
多載
| 名稱 | Description |
|---|---|
| VisitAndConvert<T>(ReadOnlyCollection<T>, String) |
造訪集合中的所有表達式,並將結果回溯到原始表達式類型。 |
| VisitAndConvert<T>(T, String) |
造訪一個表達式,將結果拋回原始表達式類型。 |
VisitAndConvert<T>(ReadOnlyCollection<T>, String)
造訪集合中的所有表達式,並將結果回溯到原始表達式類型。
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)
造訪一個表達式,將結果拋回原始表達式類型。
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
若修改過的表達式或任何子表達式被修改;否則,回傳原始表達式。
例外狀況
該節點的造訪方法回傳了不同的類型。