Adding columns and conditions with code

Here we suppose that our Query object is referenced as query

private void AddColumnsConditionsByCode() {
    //add a simple column
    query.AddSimpleColumn("Customers.CompanyName", "Customer");
    query.AddSimpleColumn("Orders.OrderDate", "Order date");

    //add an aggregate column
    var attr = query.Model.FindEntityAttr("Orders.Freight");
    var expr = query.CreateAggrFuncExpr("SUM", query.CreateEntityAttrExpr(attr));
    var col = query.CreateColumn();
    col.Caption = "Total";
    col.Expr = expr;

    //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(Condition.LinkType.Any);
    group.AddSimpleCondition("Customers.City", "Equal", "London");
    group.AddSimpleCondition("Customer.City", "Equal", "NewYork");
    //generate SQL statement
    SqlQueryBuilder builder = new SqlQueryBuilder(query);
    string sql = builder.Result.SQL;