DbExpressionBuilder.Constant 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會產生一個新的 DbConstantExpression。
多載
| 名稱 | Description |
|---|---|
| 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
代表的恆定價值。
傳回
一個新的 DbConstantExpression,給定值為 ,結果型別為 constantType。
例外狀況
value 或 constantType 為空值。
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 不是有效常數型別的實例。