DbExpressionBuilder.Constant 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Constant(TypeUsage, Object) |
DbConstantExpression使用给定的常量值创建新的指定基元类型。 |
| Constant(Object) |
使用给定的常量值创建一个新 DbConstantExpression 项。 |
Constant(TypeUsage, Object)
DbConstantExpression使用给定的常量值创建新的指定基元类型。
public static System.Data.Entity.Core.Common.CommandTrees.DbConstantExpression Constant(this System.Data.Entity.Core.Metadata.Edm.TypeUsage constantType, object value);
static member Constant : System.Data.Entity.Core.Metadata.Edm.TypeUsage * obj -> System.Data.Entity.Core.Common.CommandTrees.DbConstantExpression
<Extension()>
Public Function Constant (constantType As TypeUsage, value As Object) As DbConstantExpression
参数
- constantType
- TypeUsage
常量值的类型。
- value
- Object
要表示的常量值。
返回
具有给定值和 constantType 结果类型的新 DbConstantExpression。
例外
value 或 constantType 为 null。
value 不是有效常量类型的实例,constantType 不表示基元类型,或者值与 constantType 表示的基元类型不同。
适用于
Constant(Object)
使用给定的常量值创建一个新 DbConstantExpression 项。
public static System.Data.Entity.Core.Common.CommandTrees.DbConstantExpression Constant(object value);
static member Constant : obj -> System.Data.Entity.Core.Common.CommandTrees.DbConstantExpression
Public Function Constant (value As Object) As DbConstantExpression
参数
- value
- Object
要表示的常量值。
返回
具有给定值的新 DbConstantExpression。
例外
值为 null。
value 不是有效常量类型的实例。