public ParameterSegment(Expression value, IHasParameters target)
        {
            m_target    = target;
            m_paramName = $"@p{target.ParametersCount + 1}";
            var val = ExpressionEvaluator.Eval(value);

            m_target.AddParameter(m_paramName, val);
        }
Beispiel #2
0
        public IQuerySegment ToSegment(ExpressionMapperBase <IQuerySegment> queryMapper, IHasParameters paramsTarget)
        {
            var model     = Build();
            var queryText = m_owner.GetQueryText(model, this);

            foreach (var p in m_parameters)
            {
                paramsTarget.AddParameter(p.Key, p.Value);
            }

            return(new SubquerySegment(queryText));
        }