Share via


SqlExpressionFactory.Convert Method

Definition

Creates a new SqlUnaryExpression which represent casting a SQL expression to different type.

public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlUnaryExpression Convert (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, Type type, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping typeMapping = default);
public virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlUnaryExpression Convert (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression operand, Type type, Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping? typeMapping = default);
abstract member Convert : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Type * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlUnaryExpression
override this.Convert : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlExpression * Type * Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SqlUnaryExpression
Public Overridable Function Convert (operand As SqlExpression, type As Type, Optional typeMapping As RelationalTypeMapping = Nothing) As SqlUnaryExpression

Parameters

operand
SqlExpression

A SqlExpression to cast.

type
Type

The return type of the expression after cast.

typeMapping
RelationalTypeMapping

A relational type mapping to use for conversion.

Returns

An expression representing cast operation in a SQL tree.

Implements

Applies to