Share via


SwitchExpression.Update 方法

定义

创建一个新的表达式,它类似于此表达式,但使用所提供的子级。 如果所有子级均相同,它将返回此表达式。

public:
 System::Linq::Expressions::SwitchExpression ^ Update(System::Linq::Expressions::Expression ^ switchValue, System::Collections::Generic::IEnumerable<System::Linq::Expressions::SwitchCase ^> ^ cases, System::Linq::Expressions::Expression ^ defaultBody);
public System.Linq.Expressions.SwitchExpression Update (System.Linq.Expressions.Expression switchValue, System.Collections.Generic.IEnumerable<System.Linq.Expressions.SwitchCase> cases, System.Linq.Expressions.Expression defaultBody);
public System.Linq.Expressions.SwitchExpression Update (System.Linq.Expressions.Expression switchValue, System.Collections.Generic.IEnumerable<System.Linq.Expressions.SwitchCase>? cases, System.Linq.Expressions.Expression? defaultBody);
member this.Update : System.Linq.Expressions.Expression * seq<System.Linq.Expressions.SwitchCase> * System.Linq.Expressions.Expression -> System.Linq.Expressions.SwitchExpression
Public Function Update (switchValue As Expression, cases As IEnumerable(Of SwitchCase), defaultBody As Expression) As SwitchExpression

参数

switchValue
Expression

结果的 SwitchValue 属性。

cases
IEnumerable<SwitchCase>

结果的 Cases 属性。

defaultBody
Expression

结果的 DefaultBody 属性。

返回

如果子级未更改,则为此表达式;否则为具有已更新子级的表达式。

适用于