Example #1
0
        public SqlExpression EndWhereExp()
        {
            if (_currentWhereExp == null)
            {
                throw new ApplicationException("Ошибка! Вложенного выражения не существует");
            }

            var exp = _currentWhereExp;

            _currentWhereExp = FindExpParent(_currentWhereExp);
            if (exp.Conditions != null && exp.Conditions.Count == 0)
            {
                if (_currentWhereExp != null)
                {
                    _currentWhereExp.Conditions.Remove(exp);
                }
                else
                {
                    WhereConditions.Remove(exp);
                }
            }

            return(_currentWhereExp);
        }