internal ODataUnaryOpExpression(ODataExpression operand, ODataUnaryOp @operator)
 // in general, unary ops don't change the type. If we ever implement one that does, we can change this logic
     : base(ODataExpressionKind.UnaryOp, operand.Type, operand.ClrType)
 {
     this.Operand  = operand;
     this.Operator = @operator;
 }
Esempio n. 2
0
        internal static ODataUnaryOpExpression UnaryOp(ODataExpression operand, ODataUnaryOp @operator)
        {
            Throw.IfNull(operand, "operand");
            Throw.If(operand.Type != ODataExpressionType.Boolean && operand.Type != ODataExpressionType.Unknown, "operand: must be a boolean type");

            var finalOperand = operand.Type == ODataExpressionType.Unknown
                ? ConvertFromUnknownType(operand, typeof(bool))
                : operand;

            return(new ODataUnaryOpExpression(finalOperand, @operator));
        }
 // in general, unary ops don't change the type. If we ever implement one that does, we can change this logic
 internal ODataUnaryOpExpression(ODataExpression operand, ODataUnaryOp @operator)
     : base(ODataExpressionKind.UnaryOp, operand.Type, operand.ClrType)
 {
     this.Operand = operand;
     this.Operator = @operator;
 }
        internal static ODataUnaryOpExpression UnaryOp(ODataExpression operand, ODataUnaryOp @operator)
        {
            Throw.IfNull(operand, "operand");
            Throw.If(operand.Type != ODataExpressionType.Boolean, "operand: must be a boolean type");

            return new ODataUnaryOpExpression(operand, @operator);
        }