Skip to content

Query Builder #6

@jasonMunsterteiger

Description

@jasonMunsterteiger

I wrote this so new users will not have to build query strings.
I am a new user myself, but I think this could be added to the Sample-Code.


//This Builds Query Strings
public string BuildQueryXML(string entity, string field, string searchText)
{
//Set our return variable as a String called query
String query = "";

        //Build our string in queryxml
        StringBuilder strResource = new StringBuilder();
        strResource.Append("<queryxml version=\"1.0\">");
        strResource.Append($"<entity>{entity}</entity>");
        strResource.Append("<query>");
        strResource.Append($"<field>{field}<expression op=\"equals\">");
        strResource.Append(searchText);
        strResource.Append("</expression></field>");
        strResource.Append("</query></queryxml>");

        //Return our query as a string
        return query;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions