Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Expression::New Method (ConstructorInfo)

Creates a NewExpression that represents calling the specified constructor that takes no arguments.

Namespace:  System.Linq.Expressions
Assemblies:   System.Core (in System.Core.dll)
  System.Linq.Expressions (in System.Linq.Expressions.dll)

public:
static NewExpression^ New(
	ConstructorInfo^ constructor
)

Parameters

constructor
Type: System.Reflection::ConstructorInfo

The ConstructorInfo to set the Constructor property equal to.

Return Value

Type: System.Linq.Expressions::NewExpression
A NewExpression that has the NodeType property equal to New and the Constructor property set to the specified value.

ExceptionCondition
ArgumentNullException

constructor is nullptr.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft