Skip to content

Query builder should use item value  #3

Description

@jabreuar

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;
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions