Exemple #1
0
        private static SelectExpression Verify(SelectExpression selectExpression)
        {
            if (selectExpression.Projection.Count != 1)
            {
                throw new InvalidOperationException(CoreStrings.TranslationFailed(selectExpression.Print()));
            }

            return(selectExpression);
        }
Exemple #2
0
        public InExpression In(SqlExpression item, SelectExpression subquery, bool negated)
        {
            var sqlExpression = subquery.Projection.Single().Expression;
            var typeMapping   = sqlExpression.TypeMapping;

            if (typeMapping == null)
            {
                throw new InvalidOperationException(
                          $"The subquery '{subquery.Print()}' references type '{sqlExpression.Type}' for which no type mapping could be found.");
            }

            item = ApplyTypeMapping(item, typeMapping);
            return(new InExpression(item, negated, subquery, _boolTypeMapping));
        }