public MsSqlQueryBuilderSelect(MsSqlDatabase database)
        {
            Database = database ?? throw new System.ArgumentNullException(nameof(database));

            _builderWhere = database.QueryFactory.CreateWhere();
            _builderWhere.And(_builderWhere);

            _limitBuilder = database.QueryFactory.CreateLimit();
        }
Beispiel #2
0
        private void AppendWhere(IQueryBuilderWhere whereQuery, string joinOperation)
        {
            if (string.IsNullOrWhiteSpace(whereQuery.ToString()))
            {
                return;
            }

            string where = string.Format(" {0} ({1})", joinOperation, whereQuery);
            _whereStrings.Add(where);
        }
        public void Where(IQueryBuilderWhere where)
        {
            int index = _builderWheres.IndexOf(where);

            if (index == -1)
            {
                _builderWheres.Add(where);
            }
            else
            {
                _builderWheres[index] = where;
            }
        }
Beispiel #4
0
 public IQueryBuilderWhere Or(IQueryBuilderWhere where)
 {
     AppendWhere(where, "OR");
     return(this);
 }
Beispiel #5
0
 public IQueryBuilderWhere And(IQueryBuilderWhere where)
 {
     AppendWhere(where, "AND");
     return(this);
 }