Expression::Constant Method (Object^, Type^)
.NET Framework (current version)
Creates a ConstantExpression that has the Value and Type properties set to the specified values.
Assembly: System.Core (in System.Core.dll)
Return Value
Type: System.Linq.Expressions::ConstantExpression^A ConstantExpression that has the NodeType property equal to Constant and the Value and Type properties set to the specified values.
| Exception | Condition |
|---|---|
| ArgumentNullException | type is null. |
| ArgumentException | value is not null and type is not assignable from the dynamic type of value. |
This method can be useful for representing values of nullable types.
Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: