共用方式為


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

要表示的常數值。

傳回

具有指定值的新 DbConstantExpression,以及 constantType 的結果類型。

例外狀況

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 不是有效常數類型的實例。

適用於