Uređivanje

Dijeli putem


DbExpressionBuilder.NewCollection Method

Definition

Creates a new DbNewInstanceExpression that constructs a collection containing the specified elements.

Overloads

NewCollection(IEnumerable<DbExpression>)

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.

NewCollection(DbExpression[])

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.

NewCollection(IEnumerable<DbExpression>)

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.

public:
 static System::Data::Common::CommandTrees::DbNewInstanceExpression ^ NewCollection(System::Collections::Generic::IEnumerable<System::Data::Common::CommandTrees::DbExpression ^> ^ elements);
public static System.Data.Common.CommandTrees.DbNewInstanceExpression NewCollection (System.Collections.Generic.IEnumerable<System.Data.Common.CommandTrees.DbExpression> elements);
static member NewCollection : seq<System.Data.Common.CommandTrees.DbExpression> -> System.Data.Common.CommandTrees.DbNewInstanceExpression
Public Function NewCollection (elements As IEnumerable(Of DbExpression)) As DbNewInstanceExpression

Parameters

elements
IEnumerable<DbExpression>

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

Returns

A new DbNewInstanceExpression with the specified collection type and arguments.

Exceptions

elements is null, or contains null.

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

Applies to

NewCollection(DbExpression[])

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.

public:
 static System::Data::Common::CommandTrees::DbNewInstanceExpression ^ NewCollection(... cli::array <System::Data::Common::CommandTrees::DbExpression ^> ^ elements);
public static System.Data.Common.CommandTrees.DbNewInstanceExpression NewCollection (params System.Data.Common.CommandTrees.DbExpression[] elements);
static member NewCollection : System.Data.Common.CommandTrees.DbExpression[] -> System.Data.Common.CommandTrees.DbNewInstanceExpression
Public Function NewCollection (ParamArray elements As DbExpression()) As DbNewInstanceExpression

Parameters

elements
DbExpression[]

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

Returns

A new DbNewInstanceExpression with the specified collection type and arguments.

Exceptions

elements is null, or contains null.

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

Applies to