public CondGroup <TDbParam> Add(Cond <TDbParam> cond) { // Empty cond makes an empty SQL. var cSql = (cond == null ? string.Empty : cond.FetchSql()); if (string.IsNullOrEmpty(cSql)) { return(this); } // append SQL if (string.IsNullOrEmpty(Sql)) { Sql = $"({cSql})"; } else { Sql += $" {CondJoin} ({cSql})"; } // push parameters Debug.Assert(cond != null, ""); // Never asserts DbParams.AddRange(cond.FetchDbParams()); return(this); }
public CondNot(Cond <TDbParam> cond) { // Empty cond makes an empty SQL. var cSql = (cond == null ? string.Empty : cond.FetchSql()); if (string.IsNullOrEmpty(cSql)) { return; } // set SQL Sql = $"NOT ({cSql})"; // push parameters Debug.Assert(cond != null, ""); // Never asserts DbParams.AddRange(cond.FetchDbParams()); }