FromExpression(IExpression)
Creates an expression statement from an IExpression (e.g., a method invocation or assignment).
Declaration
public static IStatement FromExpression(IExpression expression)Parameters
| Type | Name | Description |
|---|---|---|
| IExpression | expression | The expression to convert into a statement. |
Returns
| Type | Description |
|---|---|
| IStatement | An IStatement that executes the expression. |
Remarks
Expression statements are statements that evaluate an expression for its side effects, such as method calls, assignments, increment/decrement operations, or object creation. The generated statement will include the terminating semicolon.