/// <summary> /// Takes any recursive SqlString parts and flattens them, resulting in an SqlString with only strings, fields and Parameters. /// </summary> /// <returns></returns> internal SqlString Flatten() { var sql = new SqlString(); Flatten(sql); return sql; }
private void Flatten(SqlString cur) { // pull out all parts to the top level foreach (var p in Parts) { if (p is SqlString) ((SqlString)p).Flatten(cur); else cur.Parts.Add(p); } }
public SqlString Add(SqlString sql) { Parts.Add(sql); return this; }