コード例 #1
0
    private static string FindAs(Expression e) {
      string result = null;
      e.VisitAll<AsExpression>(x => result = x.Name);

      return result;
    }
コード例 #2
0
    public void AddColumn(Expression col) {
      string asName = FindAs(col);

      string colName = asName;
      if (asName == null) colName = "col_" + (myColumns.Count + 1);

      bool binded = false;
      col.VisitAll<BindExpression>(x => {
                                     x.BindColumn.Name = colName;
                                     binded = true;
                                   });

      myColumns.Add(new KeyValuePair<string, Expression>(
                      (binded || asName != null) ? colName : null,
                      col));
    }