Expression.New Method (ConstructorInfo)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Creates a NewExpression that represents calling the specified constructor that takes no arguments.
Assembly: System.Core (in System.Core.dll)
Parameters
- constructor
- Type: System.Reflection.ConstructorInfo
The ConstructorInfo to set the Constructor property equal to.
Return Value
Type: System.Linq.Expressions.NewExpressionA NewExpression that has the NodeType property equal to New and the Constructor property set to the specified value.
| Exception | Condition |
|---|---|
| ArgumentNullException | constructor is null. |
| ArgumentException | The constructor that constructor represents has at least one parameter. |
The Arguments and Members properties of the resulting NewExpression are empty collections. The Type property represents the declaring type of the constructor represented by constructor.