DbExpressionBuilder.Constant 方法

定义

创建新的 DbConstantExpression

重载

名称 说明
Constant(TypeUsage, Object)

DbConstantExpression使用给定的常量值创建新的指定基元类型。

Constant(Object)

使用给定的常量值创建一个新 DbConstantExpression 项。

Constant(TypeUsage, Object)

DbConstantExpression使用给定的常量值创建新的指定基元类型。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbConstantExpression ^ Constant(System::Data::Metadata::Edm::TypeUsage ^ constantType, System::Object ^ value);
public static System.Data.Common.CommandTrees.DbConstantExpression Constant(this System.Data.Metadata.Edm.TypeUsage constantType, object value);
static member Constant : System.Data.Metadata.Edm.TypeUsage * obj -> System.Data.Common.CommandTrees.DbConstantExpression
<Extension()>
Public Function Constant (constantType As TypeUsage, value As Object) As DbConstantExpression

参数

constantType
TypeUsage

常量值的类型。

value
Object

要表示的常量值。

返回

具有给定值和结果类型的 constantType新 DbConstantExpression。

例外

valueconstantType 为 null。

value 不是有效常量类型的实例, constantType 不表示基元类型,或者 value 与由 constantType该类型表示的基元类型不同。

适用于

Constant(Object)

使用给定的常量值创建一个新 DbConstantExpression 项。

public:
 static System::Data::Common::CommandTrees::DbConstantExpression ^ Constant(System::Object ^ value);
public static System.Data.Common.CommandTrees.DbConstantExpression Constant(object value);
static member Constant : obj -> System.Data.Common.CommandTrees.DbConstantExpression
Public Function Constant (value As Object) As DbConstantExpression

参数

value
Object

要表示的常量值。

返回

具有给定值的新 DbConstantExpression。

例外

value 为 null。

value 不是有效常量类型的实例。

适用于