DbExpressionBuilder.Constant 方法

定义

重载

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 不表示基元类型,或者 value 与 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 不是有效常量类型的实例。

适用于