DbExpressionBuilder.CastTo(DbExpression, TypeUsage) 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 DbCastExpression that applies a cast operation to a polymorphic argument.
public static System.Data.Entity.Core.Common.CommandTrees.DbCastExpression CastTo (this System.Data.Entity.Core.Common.CommandTrees.DbExpression argument, System.Data.Entity.Core.Metadata.Edm.TypeUsage toType);
static member CastTo : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Metadata.Edm.TypeUsage -> System.Data.Entity.Core.Common.CommandTrees.DbCastExpression
<Extension()>
Public Function CastTo (argument As DbExpression, toType As TypeUsage) As DbCastExpression
Parameters
- argument
- DbExpression
The argument to which the cast should be applied.
- toType
- TypeUsage
Type metadata that specifies the type to cast to.
Returns
A new DbCastExpression with the specified argument and target type.
Exceptions
Argument or toType is null.
The specified cast is not valid.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework