Skip to content

Instantly share code, notes, and snippets.

@TeaDrivenDev
Created March 11, 2014 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TeaDrivenDev/9477037 to your computer and use it in GitHub Desktop.
Save TeaDrivenDev/9477037 to your computer and use it in GitHub Desktop.
// This....
QueryByAttribute qba = new QueryByAttribute("entityName")
{
ColumnSet = new ColumnSet("fieldA", "fieldB")
};
// There may be several of these lines
qba.AddAttributeValue("fieldC", "fieldCValue");
// ....becomes this
QueryExpression qex = new QueryExpression("entityName")
{
ColumnSet = new ColumnSet("fieldA", "fieldB")
};
qex.Criteria.AddCondition("fieldC", ConditionOperator.Equal, "fieldCValue");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment