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

DbExpressionBuilder.NewCollection Method (IEnumerable<DbExpression>)

.NET Framework 4.6 and 4.5

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(
	IEnumerable<DbExpression> elements
)

Parameters

elements
Type: System.Collections.Generic.IEnumerable<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.

ExceptionCondition
ArgumentNullException

elements is null, or contains null.

ArgumentException

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

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft