Share via


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 不是有效常量类型的实例。

适用于