Beispiel #1
0
        public ParametrizedSql Build()
        {
            var sql = new StringBuilder();

            sql.AppendFormat(Skip, $"@{SkipQueryParam}");
            _parameters.Add(SkipQueryParam, _request.Skip);

            sql.AppendFormat(Take, $"@{TakeQueryParam}");
            _parameters.Add(TakeQueryParam, _request.Take);

            return(ParametrizedSql.Create(sql.ToString(), _parameters));
        }
Beispiel #2
0
        public ParametrizedSql Build()
        {
            var sql = new StringBuilder();

            if (_request.Filter == null || !_request.Filter.HasFilters() || !AtLeastOneFilterIsValid(_request.Filter))
            {
                return(ParametrizedSql.CreateEmpty());
            }

            sql.Append(" WHERE");
            sql.Append("(");
            sql.Append(AddFilter(_request.Filter));
            sql.Append(")");

            return(ParametrizedSql.Create(sql.ToString(), _parameters));
        }