private SqlExpression ApplyTypeMappingOnSqlUnary( SqlUnaryExpression sqlUnaryExpression, CoreTypeMapping?typeMapping) { SqlExpression operand; CoreTypeMapping resultTypeMapping; switch (sqlUnaryExpression.OperatorType) { case ExpressionType.Equal: case ExpressionType.NotEqual: case ExpressionType.Not: resultTypeMapping = _boolTypeMapping; operand = ApplyDefaultTypeMapping(sqlUnaryExpression.Operand); break; case ExpressionType.Convert: resultTypeMapping = typeMapping; operand = ApplyDefaultTypeMapping(sqlUnaryExpression.Operand); break; case ExpressionType.Negate: resultTypeMapping = typeMapping; operand = ApplyTypeMapping(sqlUnaryExpression.Operand, typeMapping); break; default: throw new InvalidOperationException(CoreStrings.TranslationFailed(sqlUnaryExpression.Print())); } return(new SqlUnaryExpression( sqlUnaryExpression.OperatorType, operand, sqlUnaryExpression.Type, resultTypeMapping)); }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> protected abstract Expression VisitSqlUnary(SqlUnaryExpression sqlUnaryExpression);
protected override Expression VisitSqlUnary(SqlUnaryExpression sqlUnaryExpression) { throw new NotImplementedException(); }