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
Assembly:  System.Core (in System.Core.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 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.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft