DbExpressionBuilder.NewCollection Method (DbExpression[])

.NET Framework (current version)
 

Creates a new DbNewInstanceExpression that constructs a collection containing the specified elements. The type of the collection is based on the common type of the elements. If no common element type exists an exception is thrown.

Namespace:   System.Data.Common.CommandTrees.ExpressionBuilder
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public static DbNewInstanceExpression NewCollection(
	params DbExpression[] elements
)

Parameters

elements
Type: System.Data.Common.CommandTrees.DbExpression[]

A list of expressions that provide the elements of the collection.

Return Value

Type: System.Data.Common.CommandTrees.DbNewInstanceExpression

A new DbNewInstanceExpression with the specified collection type and arguments.

Exception Condition
ArgumentNullException

elements is null, or contains null..

ArgumentException

elements is empty or contains expressions for which no common result type exists.

.NET Framework
Available since 4.5
Return to top
Show: