DbExpressionBuilder.Constant Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new DbConstantExpression.
Overloads
Constant(TypeUsage, Object) |
Creates a new DbConstantExpression of the specified primitive type with the given constant value. |
Constant(Object) |
Creates a new DbConstantExpression with the given constant value. |
Constant(TypeUsage, Object)
Creates a new DbConstantExpression of the specified primitive type with the given constant value.
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
Parameters
- constantType
- TypeUsage
The type of the constant value.
- value
- Object
The constant value to represent.
Returns
A new DbConstantExpression with the given value and a result type of constantType
.
Exceptions
value
or constantType
is null.
value
is not an instance of a valid constant type, constantType
does not represent a primitive type, or value
is of a different primitive type than that represented by constantType
.
Applies to
Constant(Object)
Creates a new DbConstantExpression with the given constant value.
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
Parameters
- value
- Object
The constant value to represent.
Returns
A new DbConstantExpression with the given value.
Exceptions
value
is null.
value
is not an instance of a valid constant type.