示例#1
0
 public ExecuteOperationApiBuilder(QueryApiQueryBuilder querySpec, string operation)
     : base(querySpec.From)
 {
     Operation = operation;
     Where(querySpec.WhereCriteria.ToArray());
     Filter(querySpec.FilterCriteria.ToArray());
 }
 public UpdateApiBuilder(QueryApiQueryBuilder querySpec, object updateAttributes)
     : base(querySpec.From)
 {
     UpdateAttributes = updateAttributes;
     Where(querySpec.WhereCriteria.ToArray());
     Filter(querySpec.FilterCriteria.ToArray());
 }
示例#3
0
        public override string ToString()
        {
            // hack temp
            var qb       = new QueryApiQueryBuilder(From);
            var criteria = Where.Where(s => s is Criterion)
                           .Cast <Criterion>();

            var wheres = criteria.Where(s => s.Operator == ComparisonOperator.Equal).ToArray();

            qb.Where(wheres);

            var filters = criteria.Where(s => s.Operator != ComparisonOperator.Equal).ToArray();

            qb.Filter(filters);

            qb.Select(this.Select.ToArray());

            if (PageSize != -1 && PageStart != -1)
            {
                qb.PageSize  = PageSize;
                qb.PageStart = PageStart;
            }

            var query = qb.ToString();

            return(query);

            //var builder = new StringBuilder();
            //var query = new StringBuilder();

            //ApplyAssetTypeName(builder);
            //MaybeApplyOidToken(builder);

            //MaybeApplySelections(query);
            //MaybeApplyWhere(query);
            //MaybeApplyPaging(query);

            //MaybeApplyQuery(query, builder);

            //return builder.ToString();
        }