Adding columns and conditions with code

Here we suppose that our Query object is referenced as query

private void AddColumnsAndConditionsByCode() 
{ 
    query.Clear();
    //add two simple columns
    query.AddSimpleColumn("Customers.CompanyName", "Customer", SortDirection.Ascending);
    query.AddSimpleColumn("Orders.OrderDate", "Order date", SortDirection.Descending);

    //add an aggregate column
    query.AddAggregateColumn("Orders.Freight", "SUM", "Total Freight");

    //add a simple condition
    query.Root.AddSimpleCondition("Customers.Country", "Equals", "USA");

    //here is one more example: how to add a group of conditions
    var group = query.AddConditionGroup();
    group.Linking = Condition.LinkType.Any;
    group.AddSimpleCondition("Customers.City", "Equal", "London");
    group.AddSimpleCondition("Customer.City", "Equal", "NewYork");

    //generate SQL statement
    var builder = new SqlQueryBuilder(query);
    builder.BuildSQL();
    string sql = builder.Result.SQL;
}