DbExpressionBuilder.NewCollection 方法
定义
创建一个新的 DbNewInstanceExpression,它构造一个包含指定元素的集合。Creates a new DbNewInstanceExpression that constructs a collection containing the specified elements.
重载
| NewCollection(IEnumerable<DbExpression>) |
创建一个新的 DbNewInstanceExpression,它构造一个包含指定元素的集合。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[]) |
创建一个新的 DbNewInstanceExpression,它构造一个包含指定元素的集合。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>)
创建一个新的 DbNewInstanceExpression,它构造一个包含指定元素的集合。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
参数
- elements
- IEnumerable<DbExpression>
提供集合元素的表达式列表。A list of expressions that provide the elements of the collection.
返回
使用指定的集合类型和参数的新 DbNewInstanceExpression。A new DbNewInstanceExpression with the specified collection type and arguments.
例外
elements 为 null 或包含 null。elements is null, or contains null.
elements 为空,或包含不存在通用结果类型的表达式。elements is empty or contains expressions for which no common result type exists.
适用于
NewCollection(DbExpression[])
创建一个新的 DbNewInstanceExpression,它构造一个包含指定元素的集合。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
参数
- elements
- DbExpression[]
提供集合元素的表达式列表。A list of expressions that provide the elements of the collection.
返回
使用指定的集合类型和参数的新 DbNewInstanceExpression。A new DbNewInstanceExpression with the specified collection type and arguments.
例外
elements 为 null 或包含 null。elements is null, or contains null.
elements 为空,或包含不存在通用结果类型的表达式。elements is empty or contains expressions for which no common result type exists.