예제 #1
0
        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);
        }
예제 #2
0
파일: CondNot.cs 프로젝트: fkdl/OpenLIS
        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());
        }