Прочетете на английски Редактиране

Споделяне чрез


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.

C#
public static System.Data.Common.CommandTrees.DbNewInstanceExpression NewCollection(System.Collections.Generic.IEnumerable<System.Data.Common.CommandTrees.DbExpression> elements);

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

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

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.

C#
public static System.Data.Common.CommandTrees.DbNewInstanceExpression NewCollection(params System.Data.Common.CommandTrees.DbExpression[] elements);

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

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1