Extent query

Jan 22, 2014 at 1:42 PM
Is it possible to extent a query after the initial query-statement has been closed?

For example, you first create a table with a column you always want to have (e.g. "essentialCol") and then add some more based on some kind of logic (e.g. If true {add col1} else {add col2}). Or in code:
DBQuery table = DBQuery.Create
                    .Table("dbo", "Table")
                    .Add("essentialCol", DbType.String);

if (<true>)
    .Add("col1", DbType.String);
    .Add("col2", DbType.String);
And if so; how would I go about this?

Thanks in advance!
Sep 19, 2014 at 4:06 PM
Edited Sep 19, 2014 at 4:08 PM
Yes, it's possible and simple as that:
if (<true>)
  table.Add("col1", DbType.String);
  table.Add("col2", DbType.String);
You can just extend your query in infinite using variable created at initial query-statement.