RepoWrapper icon indicating copy to clipboard operation
RepoWrapper copied to clipboard

Query builder should use item value

Open jabreuar opened this issue 7 years ago • 0 comments

I found another problem, you're using item.QueryOperator instead of property value, as shown below:

if (!string.IsNullOrEmpty(item.LinkingOperator) && i > 0) { builder.Append(string.Format("{0} {1} {2} @{1} ", item.LinkingOperator, item.PropertyName, item.QueryOperator)); } else { builder.Append(string.Format("{0} {1} @{0} ", item.PropertyName, item.QueryOperator)); }

I already fixed it, you can use the code below:

for (int i = 0; i < queryProperties.Count(); i++) { QueryParameter item = queryProperties[i];

            if (!string.IsNullOrEmpty(item.LinkingOperator) && i > 0)
                builder.Append($"{item.LinkingOperator} {item.FieldName} {item.QueryOperator} {item.Value} ");
            else
                builder.Append($"{item.FieldName} {item.QueryOperator} {item.Value} ");

            expandoObj[item.FieldName] = item.Value;
        }

jabreuar avatar Jul 04 '17 18:07 jabreuar