DbExpressionBuilder.New 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建新的 DbNewInstanceExpression。
重载
| 名称 | 说明 |
|---|---|
| New(TypeUsage, IEnumerable<DbExpression>) |
创建新的 DbNewInstanceExpression。 如果类型参数是集合类型,则参数指定集合的元素。 否则,参数将用作新实例中的属性或列值。 |
| New(TypeUsage, DbExpression[]) |
创建新的 DbNewInstanceExpression。 如果类型参数是集合类型,则参数指定集合的元素。 否则,参数将用作新实例中的属性或列值。 |
New(TypeUsage, IEnumerable<DbExpression>)
创建新的 DbNewInstanceExpression。 如果类型参数是集合类型,则参数指定集合的元素。 否则,参数将用作新实例中的属性或列值。
public:
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbNewInstanceExpression ^ New(System::Data::Metadata::Edm::TypeUsage ^ instanceType, System::Collections::Generic::IEnumerable<System::Data::Common::CommandTrees::DbExpression ^> ^ arguments);
public static System.Data.Common.CommandTrees.DbNewInstanceExpression New(this System.Data.Metadata.Edm.TypeUsage instanceType, System.Collections.Generic.IEnumerable<System.Data.Common.CommandTrees.DbExpression> arguments);
static member New : System.Data.Metadata.Edm.TypeUsage * seq<System.Data.Common.CommandTrees.DbExpression> -> System.Data.Common.CommandTrees.DbNewInstanceExpression
<Extension()>
Public Function New (instanceType As TypeUsage, arguments As IEnumerable(Of DbExpression)) As DbNewInstanceExpression
参数
- instanceType
- TypeUsage
新实例的类型。
- arguments
- IEnumerable<DbExpression>
指定新实例值的表达式,根据实例的类型进行解释。
返回
具有指定类型和参数的新 DbNewInstanceExpression。
例外
instanceType 或 arguments 为 null,或 arguments 包含 null。
arguments 为空或包含表达式的结果类型不符合(如备注部分所述) 的要求 instanceType 。
注解
如果是 instanceType 集合类型,则每个 arguments 表达式都必须具有可提升到元素 instanceType类型的结果类型。 如果 instanceType 为行类型, arguments 则必须包含行类型中存在列的表达式数,并且每个表达式的结果类型必须等于或可提升到相应列的类型。 不声明任何列的行类型无效。 如果 instanceType 为实体类型, arguments 则必须包含由该类型定义的属性的数量,并且每个表达式的结果类型必须等于或可提升到相应属性的类型。
适用于
New(TypeUsage, DbExpression[])
创建新的 DbNewInstanceExpression。 如果类型参数是集合类型,则参数指定集合的元素。 否则,参数将用作新实例中的属性或列值。
public:
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbNewInstanceExpression ^ New(System::Data::Metadata::Edm::TypeUsage ^ instanceType, ... cli::array <System::Data::Common::CommandTrees::DbExpression ^> ^ arguments);
public static System.Data.Common.CommandTrees.DbNewInstanceExpression New(this System.Data.Metadata.Edm.TypeUsage instanceType, params System.Data.Common.CommandTrees.DbExpression[] arguments);
static member New : System.Data.Metadata.Edm.TypeUsage * System.Data.Common.CommandTrees.DbExpression[] -> System.Data.Common.CommandTrees.DbNewInstanceExpression
<Extension()>
Public Function New (instanceType As TypeUsage, ParamArray arguments As DbExpression()) As DbNewInstanceExpression
参数
- instanceType
- TypeUsage
新实例的类型。
- arguments
- DbExpression[]
指定新实例值的表达式,根据实例的类型进行解释。
返回
具有指定类型和参数的新 DbNewInstanceExpression。
例外
instanceType 或 arguments 为 null,或 arguments 包含 null。
arguments 为空或包含表达式的结果类型不符合(如备注部分所述) 的要求 instanceType 。
注解
如果是 instanceType 集合类型,则每个 arguments 表达式都必须具有可提升到元素 instanceType类型的结果类型。 如果 instanceType 为行类型, arguments 则必须包含行类型中存在列的表达式数,并且每个表达式的结果类型必须等于或可提升到相应列的类型。 不声明任何列的行类型无效。 如果 instanceType 为实体类型, arguments 则必须包含由该类型定义的属性的数量,并且每个表达式的结果类型必须等于或可提升到相应属性的类型。